Skip to content

Commit

Permalink
Merge pull request #4537 from yiisoft/4533-phan-check-improvements
Browse files Browse the repository at this point in the history
PHAN refactoring improvements
  • Loading branch information
marcovtwout authored Nov 14, 2023
2 parents 0361fac + ab7b70f commit 6d8e867
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Version 1.1.29 under development
- Bug #4523: Fixed translated in Greek class messages in framework requirements view, which they should not be translated (lourdas)
- Bug #4534: PHP 8.2 compatibility: Fix deprecated dynamic properties in gii/components/Pear/Text/Diff (mdeweerd, marcovtwout)
- Enh #4529: Exceptions thrown while loading fixture file rows now contain more details (eduardor2k)
- Enh #4533: Various refactorings applied based on PHAN checks (marcovtwout)

Version 1.1.28 February 28, 2023
--------------------------------
Expand Down
2 changes: 0 additions & 2 deletions framework/base/CComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public function __get($name)
* </pre>
* @param string $name the property name or the event name
* @param mixed $value the property value or callback
* @return mixed
* @throws CException if the property/event is not defined or the property is read only.
* @see __get
*/
Expand Down Expand Up @@ -210,7 +209,6 @@ public function __isset($name)
* to allow using unset() to set a component property to be null.
* @param string $name the property name or the event name
* @throws CException if the property is read only.
* @return mixed
*/
public function __unset($name)
{
Expand Down
1 change: 0 additions & 1 deletion framework/base/CSecurityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ private function substr($string,$start,$length)
/**
* Checks if a key is valid for {@link cryptAlgorithm}.
* @param string $key the key to check
* @return boolean the validation result
* @throws CException if the supported key lengths of the cipher are unknown
*/
protected function validateEncryptionKey($key)
Expand Down
1 change: 0 additions & 1 deletion framework/caching/CCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ public function offsetSet($id, $value)
* Deletes the value with the specified key from cache
* This method is required by the interface ArrayAccess.
* @param string $id the key of the value to be deleted
* @return boolean if no error happens during deletion
*/
#[ReturnTypeWillChange]
public function offsetUnset($id)
Expand Down
1 change: 0 additions & 1 deletion framework/caching/CDummyCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ public function offsetSet($id, $value)
* Deletes the value with the specified key from cache
* This method is required by the interface ArrayAccess.
* @param string $id the key of the value to be deleted
* @return boolean if no error happens during deletion
*/
#[ReturnTypeWillChange]
public function offsetUnset($id)
Expand Down
2 changes: 0 additions & 2 deletions framework/cli/commands/shell/ModelCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ protected function isRelationTable($table)

/**
* Generate code to put in ActiveRecord class's relations() function.
* @return array indexed by table names, each entry contains array of php code to go in appropriate ActiveRecord class.
* Empty array is returned if database couldn't be connected.
*/
protected function generateRelations()
{
Expand Down
2 changes: 1 addition & 1 deletion framework/db/schema/mssql/CMssqlPdoAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CMssqlPdoAdapter extends PDO
* Get the last inserted id value
* MSSQL doesn't support sequence, so, argument is ignored
*
* @param string|null sequence name. Defaults to null
* @param string|null $sequence sequence name. Defaults to null
* @return integer last inserted id
*/
#[ReturnTypeWillChange]
Expand Down
8 changes: 4 additions & 4 deletions framework/gii/generators/model/ModelCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ protected function generateRelations()
/**
* Checks if the given table is a "many to many" pivot table.
* Their PK has 2 fields, and both of those fields are also FK to other separate tables.
* @param CDbTableSchema table to inspect
* @param CDbTableSchema $table table to inspect
* @return boolean true if table matches description of helper table.
*/
protected function isRelationTable($table)
Expand Down Expand Up @@ -394,9 +394,9 @@ protected function generateClassName($tableName)

/**
* Generate a name for use as a relation name (inside relations() function in a model).
* @param string the name of the table to hold the relation
* @param string the foreign key name
* @param boolean whether the relation would contain multiple objects
* @param string $tableName the name of the table to hold the relation
* @param string $fkName the foreign key name
* @param boolean $multiple whether the relation would contain multiple objects
* @return string the relation name
*/
protected function generateRelationName($tableName, $fkName, $multiple)
Expand Down
1 change: 0 additions & 1 deletion framework/gii/generators/model/ModelGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class ModelGenerator extends CCodeGenerator
/**
* Provides autocomplete table names
* @param string $db the database connection component id
* @return string the json array of tablenames that contains the entered term $q
*/
public function actionGetTableNames($db)
{
Expand Down
1 change: 0 additions & 1 deletion framework/messages/ca/yii.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
'Active Record requires a "db" CDbConnection application component.' => 'Active Record requiereix un component d\'aplicació "db" de tipus CDbConnection.',
'Active record "{class}" has an invalid configuration for relation "{relation}". It must specify the relation type, the related active record class and the foreign key.' => 'Active record "{class}" conté una configuració de relació invàlida "{relation}". La mateixa ha d\'especificar el tipus de relació, la clase active record relacionada i la clau forània.',
'Active record "{class}" is trying to select an invalid column "{column}". Note, the column must exist in the table or be an expression with alias.' => 'Active Record "{class}" esta intentant seleccionar una columna que no és vàlida {"column"}. Nota: la columna pot existir a la BDD o ser una expressió amb àlies.',
'Alias "{alias}" is invalid. Make sure it points to an existing directory or file.' => 'Alias "{alias}" es inválido. Verifique que el mismo apunta a un directorio o archivo exisitente.',
'Alias "{alias}" is invalid. Make sure it points to an existing directory or file.' => 'L\'àlies "{alias}" no és vàlid. Verifiqui que el mateix apunta a un directori o arxiu exisitent.',
'Application base path "{path}" is not a valid directory.' => 'Ruta base de l\'aplicació "{path}" no és un directori vàlid.',
'Application runtime path "{path}" is not valid. Please make sure it is a directory writable by the Web server process.' => 'Ruta de runtime d\'aplicació "{path}" no és vàlida. Asseguri\'s de que sigui un directori amb permisos d\'escriptura pel procés que corre el servidor Web.',
Expand Down
1 change: 0 additions & 1 deletion framework/web/CHttpSessionIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class CHttpSessionIterator implements Iterator

/**
* Constructor.
* @param array the data to be iterated through
*/
public function __construct()
{
Expand Down
1 change: 0 additions & 1 deletion framework/web/actions/CViewAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ public function getRequestedView()
/**
* Resolves the user-specified view into a valid view name.
* @param string $viewPath user-specified view in the format of 'path.to.view'.
* @return string fully resolved view in the format of 'path/to/view'.
* @throws CHttpException if the user-specified view is invalid
*/
protected function resolveView($viewPath)
Expand Down
1 change: 0 additions & 1 deletion framework/web/widgets/COutputCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ class COutputCache extends CFilterWidget
* Performs filtering before the action is executed.
* This method is meant to be overridden by child classes if begin-filtering is needed.
* @param CFilterChain $filterChain list of filters being applied to an action
* @return boolean whether the filtering process should stop after this filter. Defaults to false.
*/
public function filter($filterChain)
{
Expand Down

0 comments on commit 6d8e867

Please sign in to comment.