Skip to content

Commit

Permalink
property codestyle framework
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Jul 29, 2014
1 parent 5976d1c commit 3a1e0f3
Show file tree
Hide file tree
Showing 160 changed files with 188 additions and 33 deletions.
9 changes: 7 additions & 2 deletions build/controllers/PhpDocController.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,20 +303,24 @@ protected function fixLineSpacing($lines)
if ($skip) {
continue;
}

// check for multi line array
if ($level > 0) {
${'endof'.$property} = $i;
$level -= substr_count($line, ']');
}

if (strncmp(trim($line), 'public $', 8) === 0 || strncmp(trim($line), 'public static $', 15) === 0) {
$endofPublic = $i;
$property = 'Public';
$level = 0;
} elseif (strncmp(trim($line), 'protected $', 11) === 0 || strncmp(trim($line), 'protected static $', 18) === 0) {
$endofProtected = $i;
$property = 'Protected';
$level = 0;
} elseif (strncmp(trim($line), 'private $', 9) === 0 || strncmp(trim($line), 'private static $', 16) === 0) {
$endofPrivate = $i;
$property = 'Private';
$level = 0;
} elseif (substr(trim($line),0 , 6) === 'const ') {
$endofConst = $i;
$property = false;
Expand All @@ -328,8 +332,9 @@ protected function fixLineSpacing($lines)
} elseif (ltrim($line)[0] !== '*' && strpos($line, 'function') !== false || trim($line) === '}') {
break;
}

// check for multi line array
if ($property !== false) {
if ($property !== false && strncmp(trim($line), "'SQLSTATE[", 10) !== 0) {
$level += substr_count($line, '[') - substr_count($line, ']');
}
}
Expand Down
1 change: 1 addition & 0 deletions framework/base/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Action extends Component
*/
public $controller;


/**
* Constructor.
*
Expand Down
1 change: 1 addition & 0 deletions framework/base/ActionEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ActionEvent extends Event
*/
public $isValid = true;


/**
* Constructor.
* @param Action $action the action associated with this action event.
Expand Down
1 change: 1 addition & 0 deletions framework/base/Behavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Behavior extends Object
*/
public $owner;


/**
* Declares event handlers for the [[owner]]'s events.
*
Expand Down
3 changes: 3 additions & 0 deletions framework/base/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Controller extends Component implements ViewContextInterface
* @event ActionEvent an event raised right after executing a controller action.
*/
const EVENT_AFTER_ACTION = 'afterAction';

/**
* @var string the ID of this controller.
*/
Expand All @@ -61,11 +62,13 @@ class Controller extends Component implements ViewContextInterface
* by [[run()]] when it is called by [[Application]] to run an action.
*/
public $action;

/**
* @var View the view object that can be used to render views or view files.
*/
private $_view;


/**
* @param string $id the ID of this controller.
* @param Module $module the module that this controller belongs to.
Expand Down
1 change: 1 addition & 0 deletions framework/base/DynamicModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class DynamicModel extends Model
{
private $_attributes = [];


/**
* Constructors.
* @param array $attributes the dynamic attributes (name-value pairs, or names) being defined
Expand Down
1 change: 1 addition & 0 deletions framework/base/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Event extends Object

private static $_events = [];


/**
* Attaches an event handler to a class-level event.
*
Expand Down
1 change: 1 addition & 0 deletions framework/base/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class Formatter extends Component
'decimalSeparator' => null,
];


/**
* Initializes the component.
*/
Expand Down
1 change: 1 addition & 0 deletions framework/base/InlineAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class InlineAction extends Action
*/
public $actionMethod;


/**
* @param string $id the ID of this action
* @param Controller $controller the controller that owns this action
Expand Down
1 change: 1 addition & 0 deletions framework/base/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess, Arrayab
*/
private $_scenario = self::SCENARIO_DEFAULT;


/**
* Returns the validation rules for attributes.
*
Expand Down
2 changes: 2 additions & 0 deletions framework/base/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class Module extends ServiceLocator
* [[Controller::defaultAction]].
*/
public $defaultRoute = 'default';

/**
* @var string the root directory of the module.
*/
Expand All @@ -127,6 +128,7 @@ class Module extends ServiceLocator
*/
private static $_instances = [];


/**
* Constructor.
* @param string $id the ID of this module
Expand Down
1 change: 1 addition & 0 deletions framework/base/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ abstract class Request extends Component
private $_scriptFile;
private $_isConsoleRequest;


/**
* Resolves the current request into a route and the associated parameters.
* @return array the first element is the route, and the second is the associated parameters.
Expand Down
1 change: 1 addition & 0 deletions framework/base/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Response extends Component
*/
public $exitStatus = 0;


/**
* Sends the response to client.
*/
Expand Down
1 change: 1 addition & 0 deletions framework/base/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class Theme extends Component
*/
public $pathMap;


/**
* Initializes the theme.
* @throws InvalidConfigException if [[basePath]] is not set.
Expand Down
2 changes: 1 addition & 1 deletion framework/base/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ class Widget extends Component implements ViewContextInterface
* @see getId()
*/
public static $autoIdPrefix = 'w';

/**
* @var Widget[] the widgets that are currently being rendered (not ended). This property
* is maintained by [[begin()]] and [[end()]] methods.
* @internal
*/
public static $stack = [];


/**
* Begins a widget.
* This method creates an instance of the calling class. It will apply the configuration
Expand Down
1 change: 1 addition & 0 deletions framework/behaviors/AttributeBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class AttributeBehavior extends Behavior
*/
public $value;


/**
* @inheritdoc
*/
Expand Down
1 change: 1 addition & 0 deletions framework/behaviors/BlameableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class BlameableBehavior extends AttributeBehavior
*/
public $value;


/**
* @inheritdoc
*/
Expand Down
1 change: 1 addition & 0 deletions framework/behaviors/SluggableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class SluggableBehavior extends AttributeBehavior
*/
public $value;


/**
* @inheritdoc
*/
Expand Down
1 change: 1 addition & 0 deletions framework/caching/ChainedDependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ChainedDependency extends Dependency
*/
public $dependOnAll = true;


/**
* Evaluates the dependency by generating and saving the data related with dependency.
* @param Cache $cache the cache component that is currently evaluating this dependency
Expand Down
1 change: 1 addition & 0 deletions framework/caching/DbCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class DbCache extends Cache
*/
public $gcProbability = 100;


/**
* Initializes the DbCache component.
* This method will initialize the [[db]] property to make sure it refers to a valid DB connection.
Expand Down
1 change: 1 addition & 0 deletions framework/caching/DbDependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class DbDependency extends Dependency
*/
public $params = [];


/**
* Generates the data needed to determine if dependency has been changed.
* This method returns the value of the global state.
Expand Down
1 change: 1 addition & 0 deletions framework/caching/Dependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ abstract class Dependency extends \yii\base\Object
*/
private static $_reusableData = [];


/**
* Evaluates the dependency by generating and saving the data related with dependency.
* This method is invoked by cache before writing data into it.
Expand Down
1 change: 1 addition & 0 deletions framework/caching/ExpressionDependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class ExpressionDependency extends Dependency
*/
public $params;


/**
* Generates the data needed to determine if dependency has been changed.
* This method returns the result of the PHP expression.
Expand Down
1 change: 1 addition & 0 deletions framework/caching/FileCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class FileCache extends Cache
*/
public $dirMode = 0775;


/**
* Initializes this component by ensuring the existence of the cache path.
*/
Expand Down
1 change: 1 addition & 0 deletions framework/caching/FileDependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class FileDependency extends Dependency
*/
public $fileName;


/**
* Generates the data needed to determine if dependency has been changed.
* This method returns the file's last modification time.
Expand Down
1 change: 1 addition & 0 deletions framework/caching/MemCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class MemCache extends Cache
* @see http://ca2.php.net/manual/en/memcached.setoptions.php
*/
public $options;

/**
* @var \Memcache|\Memcached the Memcache instance
*/
Expand Down
1 change: 1 addition & 0 deletions framework/caching/TagDependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class TagDependency extends Dependency
*/
public $tags = [];


/**
* Generates the data needed to determine if dependency has been changed.
* This method does nothing in this class.
Expand Down
1 change: 1 addition & 0 deletions framework/captcha/Captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Captcha extends InputWidget
*/
public $options = ['class' => 'form-control'];


/**
* Initializes the widget.
*/
Expand Down
2 changes: 2 additions & 0 deletions framework/captcha/CaptchaAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CaptchaAction extends Action
* The name of the GET parameter indicating whether the CAPTCHA image should be regenerated.
*/
const REFRESH_GET_VAR = 'refresh';

/**
* @var integer how many times should the same CAPTCHA be displayed. Defaults to 3.
* A value less than or equal to 0 means the test is unlimited (available since version 1.1.2).
Expand Down Expand Up @@ -98,6 +99,7 @@ class CaptchaAction extends Action
*/
public $fixedVerifyCode;


/**
* Initializes the action.
* @throws InvalidConfigException if the font file does not exist.
Expand Down
1 change: 1 addition & 0 deletions framework/captcha/CaptchaValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class CaptchaValidator extends Validator
*/
public $captchaAction = 'site/captcha';


/**
* @inheritdoc
*/
Expand Down
1 change: 1 addition & 0 deletions framework/console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Application extends \yii\base\Application
*/
public $controller;


/**
* @inheritdoc
*/
Expand Down
2 changes: 1 addition & 1 deletion framework/console/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ class Controller extends \yii\base\Controller
* @var boolean whether to run the command interactively.
*/
public $interactive = true;

/**
* @var boolean whether to enable ANSI color in the output.
* If not set, ANSI color will only be enabled for terminals that support it.
*/
public $color;


/**
* Returns a value indicating whether ANSI color is enabled.
*
Expand Down
1 change: 1 addition & 0 deletions framework/console/Markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Markdown extends \cebe\markdown\Parser
'_', // underscore
];


/**
* @inheritDoc
*/
Expand Down
1 change: 1 addition & 0 deletions framework/console/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Request extends \yii\base\Request
{
private $_params;


/**
* Returns the command line arguments.
* @return array the command line arguments. It does not include the entry script name.
Expand Down
1 change: 1 addition & 0 deletions framework/console/controllers/AssetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class AssetController extends Controller
*/
private $_assetManager = [];


/**
* Returns the asset manager instance.
* @throws \yii\console\Exception on invalid configuration.
Expand Down
1 change: 1 addition & 0 deletions framework/console/controllers/BaseMigrateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ abstract class BaseMigrateController extends Controller
*/
public $templateFile;


/**
* @inheritdoc
*/
Expand Down
1 change: 1 addition & 0 deletions framework/console/controllers/MessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class MessageController extends Controller
*/
public $defaultAction = 'extract';


/**
* Creates a configuration file for the "extract" command.
*
Expand Down
1 change: 1 addition & 0 deletions framework/console/controllers/MigrateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class MigrateController extends BaseMigrateController
*/
public $db = 'db';


/**
* @inheritdoc
*/
Expand Down
1 change: 1 addition & 0 deletions framework/data/BaseDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ abstract class BaseDataProvider extends Component implements DataProviderInterfa
private $_models;
private $_totalCount;


/**
* Prepares the data models that will be made available in the current page.
* @return array the available data models
Expand Down
Loading

0 comments on commit 3a1e0f3

Please sign in to comment.