for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Trait with methods to manipulate the $validKeys property
*
* @category PHPExif
* @copyright Copyright (c) 2016 Tom Van Herreweghe <[email protected]>
* @license http://github.com/PHPExif/php-exif-exiftool/blob/master/LICENSE MIT License
* @link http://github.com/PHPExif/php-exif-exiftool for the canonical source repository
* @package Exiftool
*/
namespace PHPExif\Adapter\Exiftool\Reader\Mapper\Exif;
* Common methods to manipulate the validKeys property
trait ValidKeysTrait
{
* Getter for validKeys
* @return array
public function getValidKeys()
return (!property_exists($this, 'validKeys')) ? [] : $this->validKeys;
validKeys
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;
}
* Setter for validKeys
* @param array $validKeys
public function setValidKeys(array $validKeys)
$this->validKeys = $validKeys;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: