Skip to content

Commit 6d8e867

Browse files
authored
Merge pull request #4537 from yiisoft/4533-phan-check-improvements
PHAN refactoring improvements
2 parents 0361fac + ab7b70f commit 6d8e867

File tree

13 files changed

+6
-17
lines changed

13 files changed

+6
-17
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Version 1.1.29 under development
88
- Bug #4523: Fixed translated in Greek class messages in framework requirements view, which they should not be translated (lourdas)
99
- Bug #4534: PHP 8.2 compatibility: Fix deprecated dynamic properties in gii/components/Pear/Text/Diff (mdeweerd, marcovtwout)
1010
- Enh #4529: Exceptions thrown while loading fixture file rows now contain more details (eduardor2k)
11+
- Enh #4533: Various refactorings applied based on PHAN checks (marcovtwout)
1112

1213
Version 1.1.28 February 28, 2023
1314
--------------------------------

framework/base/CComponent.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ public function __get($name)
141141
* </pre>
142142
* @param string $name the property name or the event name
143143
* @param mixed $value the property value or callback
144-
* @return mixed
145144
* @throws CException if the property/event is not defined or the property is read only.
146145
* @see __get
147146
*/
@@ -210,7 +209,6 @@ public function __isset($name)
210209
* to allow using unset() to set a component property to be null.
211210
* @param string $name the property name or the event name
212211
* @throws CException if the property is read only.
213-
* @return mixed
214212
*/
215213
public function __unset($name)
216214
{

framework/base/CSecurityManager.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,6 @@ private function substr($string,$start,$length)
522522
/**
523523
* Checks if a key is valid for {@link cryptAlgorithm}.
524524
* @param string $key the key to check
525-
* @return boolean the validation result
526525
* @throws CException if the supported key lengths of the cipher are unknown
527526
*/
528527
protected function validateEncryptionKey($key)

framework/caching/CCache.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ public function offsetSet($id, $value)
370370
* Deletes the value with the specified key from cache
371371
* This method is required by the interface ArrayAccess.
372372
* @param string $id the key of the value to be deleted
373-
* @return boolean if no error happens during deletion
374373
*/
375374
#[ReturnTypeWillChange]
376375
public function offsetUnset($id)

framework/caching/CDummyCache.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ public function offsetSet($id, $value)
158158
* Deletes the value with the specified key from cache
159159
* This method is required by the interface ArrayAccess.
160160
* @param string $id the key of the value to be deleted
161-
* @return boolean if no error happens during deletion
162161
*/
163162
#[ReturnTypeWillChange]
164163
public function offsetUnset($id)

framework/cli/commands/shell/ModelCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ protected function isRelationTable($table)
121121

122122
/**
123123
* Generate code to put in ActiveRecord class's relations() function.
124-
* @return array indexed by table names, each entry contains array of php code to go in appropriate ActiveRecord class.
125-
* Empty array is returned if database couldn't be connected.
126124
*/
127125
protected function generateRelations()
128126
{

framework/db/schema/mssql/CMssqlPdoAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CMssqlPdoAdapter extends PDO
2020
* Get the last inserted id value
2121
* MSSQL doesn't support sequence, so, argument is ignored
2222
*
23-
* @param string|null sequence name. Defaults to null
23+
* @param string|null $sequence sequence name. Defaults to null
2424
* @return integer last inserted id
2525
*/
2626
#[ReturnTypeWillChange]

framework/gii/generators/model/ModelCode.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ protected function generateRelations()
362362
/**
363363
* Checks if the given table is a "many to many" pivot table.
364364
* Their PK has 2 fields, and both of those fields are also FK to other separate tables.
365-
* @param CDbTableSchema table to inspect
365+
* @param CDbTableSchema $table table to inspect
366366
* @return boolean true if table matches description of helper table.
367367
*/
368368
protected function isRelationTable($table)
@@ -394,9 +394,9 @@ protected function generateClassName($tableName)
394394

395395
/**
396396
* Generate a name for use as a relation name (inside relations() function in a model).
397-
* @param string the name of the table to hold the relation
398-
* @param string the foreign key name
399-
* @param boolean whether the relation would contain multiple objects
397+
* @param string $tableName the name of the table to hold the relation
398+
* @param string $fkName the foreign key name
399+
* @param boolean $multiple whether the relation would contain multiple objects
400400
* @return string the relation name
401401
*/
402402
protected function generateRelationName($tableName, $fkName, $multiple)

framework/gii/generators/model/ModelGenerator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class ModelGenerator extends CCodeGenerator
77
/**
88
* Provides autocomplete table names
99
* @param string $db the database connection component id
10-
* @return string the json array of tablenames that contains the entered term $q
1110
*/
1211
public function actionGetTableNames($db)
1312
{

framework/messages/ca/yii.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
'Active Record requires a "db" CDbConnection application component.' => 'Active Record requiereix un component d\'aplicació "db" de tipus CDbConnection.',
8585
'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.',
8686
'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.',
87-
'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.',
8887
'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.',
8988
'Application base path "{path}" is not a valid directory.' => 'Ruta base de l\'aplicació "{path}" no és un directori vàlid.',
9089
'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.',

0 commit comments

Comments
 (0)