for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/* @description Transformation Style Sheets - Revolutionising PHP templating *
* @author Tom Butler [email protected] *
* @copyright 2015 Tom Butler <[email protected]> | https://r.je/ *
* @license http://www.opensource.org/licenses/bsd-license.php BSD License *
* @version 1.0 */
namespace Transphporm;
/* Handles data() and iteration() function calls from the stylesheet */
class FunctionSet {
private $dataStorage;
$dataStorage
This check marks private properties in classes that are never used. Those properties can be removed.
private $data;
$data
private $baseDir;
public function __construct(Hook\ElementData $elementData, &$baseDir) {
$this->baseDir = &$baseDir;
$this->elementData = $elementData;
elementData
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
public function __call($name, $args) {
if (isset($this->functions[$name])) {
return $this->functions[$name]->run($args[0], $args[1]);
functions
else return \Transphporm\Parser\Value::IS_NOT_FUNCTION;
public function addFunction($name, \Transphporm\TSSFunction $function) {
$this->functions[$name] = $function;
This check marks private properties in classes that are never used. Those properties can be removed.