PHPCS fixing and avoid returns in some constructors

This commit is contained in:
Benoît Burnichon
2015-05-06 19:06:06 +02:00
parent 8f8030bb11
commit 4db591a12a
3 changed files with 14 additions and 105 deletions

View File

@@ -67,10 +67,9 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
protected $app; protected $app;
/** /**
* * @param Application $app
* @param databox $databox * @param databox $databox
* @param media_subdef $media_subdef * @param media_subdef $media_subdef
* @return media_Permalink_Adapter
*/ */
protected function __construct(Application $app, databox $databox, media_subdef $media_subdef) protected function __construct(Application $app, databox $databox, media_subdef $media_subdef)
{ {
@@ -79,8 +78,6 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
$this->media_subdef = $media_subdef; $this->media_subdef = $media_subdef;
$this->load(); $this->load();
return $this;
} }
/** /**
@@ -297,7 +294,6 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
} }
/** /**
*
* @param Application $app * @param Application $app
* @param databox $databox * @param databox $databox
* @param media_subdef $media_subdef * @param media_subdef $media_subdef

View File

@@ -138,9 +138,8 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
/** /**
* @param Application $app * @param Application $app
* @param record_adapter $record * @param record_adapter $record
* @param type $name * @param string $name
* @param type $substitute * @param bool $substitute
* @return media_subdef
*/ */
public function __construct(Application $app, record_adapter $record, $name, $substitute = false) public function __construct(Application $app, record_adapter $record, $name, $substitute = false)
{ {
@@ -150,8 +149,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->load($substitute); $this->load($substitute);
$this->generate_url(); $this->generate_url();
return $this;
} }
/** /**

View File

@@ -35,113 +35,32 @@ use Alchemy\Phrasea\Core\PhraseaTokens;
class record_adapter implements RecordInterface, cache_cacheableInterface class record_adapter implements RecordInterface, cache_cacheableInterface
{ {
/**
*
* @var <type>
*/
protected $xml; protected $xml;
/**
*
* @var <type>
*/
protected $base_id; protected $base_id;
/**
*
* @var <type>
*/
protected $record_id; protected $record_id;
/**
*
* @var <type>
*/
protected $mime; protected $mime;
/**
*
* @var <type>
*/
protected $number; protected $number;
/**
*
* @var <type>
*/
protected $status; protected $status;
/**
*
* @var <type>
*/
protected $subdefs; protected $subdefs;
/**
*
* @var <type>
*/
protected $type; protected $type;
/**
*
* @var <type>
*/
protected $sha256; protected $sha256;
/**
*
* @var <type>
*/
protected $grouping; protected $grouping;
/**
*
* @var <type>
*/
protected $duration; protected $duration;
/** @var databox */
/**
*
* @var databox
*/
protected $databox; protected $databox;
/** @var DateTime */
/**
*
* @var DateTime
*/
protected $creation_date; protected $creation_date;
/** @var string */
/**
*
* @var string
*/
protected $original_name; protected $original_name;
/** @var array */
/**
*
* @var Array
*/
protected $technical_datas; protected $technical_datas;
/** @var caption_record */
/**
*
* @var caption_record
*/
protected $caption_record; protected $caption_record;
/** @var string */
/**
*
* @var string
*/
protected $uuid; protected $uuid;
/** @var DateTime */
/**
*
* @var DateTime
*/
protected $modification_date; protected $modification_date;
/** @var Application */
protected $app; protected $app;
const CACHE_ORIGINAL_NAME = 'originalname'; const CACHE_ORIGINAL_NAME = 'originalname';
@@ -154,13 +73,10 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
const CACHE_STATUS = 'status'; const CACHE_STATUS = 'status';
/** /**
*
* @param Application $app * @param Application $app
* @param integer $sbas_id * @param integer $sbas_id
* @param integer $record_id * @param integer $record_id
* @param integer $number * @param integer $number
*
* @return record_adapter
*/ */
public function __construct(Application $app, $sbas_id, $record_id, $number = null) public function __construct(Application $app, $sbas_id, $record_id, $number = null)
{ {
@@ -169,7 +85,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$this->number = (int) $number; $this->number = (int) $number;
$this->record_id = (int) $record_id; $this->record_id = (int) $record_id;
return $this->load(); $this->load();
} }
protected function load() protected function load()