We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is a class with protected property $tasks which is an array:
$tasks
class TaskManager { protected $tasks = array(); }
There is also an advice which intercepts an access to this property:
/** * Access interceptor * @param FieldAccess $property Joinpoint * * @Around("access(protected TaskManager->tasks)") * @return mixed */ public function tasksChangeWatcher(FieldAccess $property) { static $tasksCount = 0; $value = $property->proceed(); $tasksCnt = count($value); if ($tasksCount != $tasksCnt) { $tasksCount = $tasksCnt; Logger::getInstance()->addInfo("Number of tasks in the queue: $tasksCount"); } return $value; }
During changing the value of this property in the application source code, php raises a warning:
Notice: Indirect modification of overloaded property TaskManager::$tasks has no effect in ...TaskManager.class.php on line 80
So if an advice applied to the private/protected property which is an array, then main source code cannot change it indirectly.
The text was updated successfully, but these errors were encountered:
e344b79
Merge remote-tracking branch 'origin/1.x'
af31666
* origin/1.x: Fix spacing Rewrote property interceptors to be by reference and use trait for general logic, resolves #54, #232
Implemented in #281
Sorry, something went wrong.
No branches or pull requests
There is a class with protected property
$tasks
which is an array:There is also an advice which intercepts an access to this property:
During changing the value of this property in the application source code, php raises a warning:
So if an advice applied to the private/protected property which is an array, then main source code cannot change it indirectly.
The text was updated successfully, but these errors were encountered: