for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/** @formatter:off
* ******************************************************************
* Created by Marko Kungla on Jul 3, 2016 - 6:22:51 PM
* Contact [email protected]
* @copyright 2016 Marko Kungla - https://github.com/mkungla
* @license The MIT License (MIT)
*
* @category AframeVR
* @package aframe-php
* Lang PHP (php version >= 7)
* Encoding UTF-8
* File AssetImage.php
* Code format PSR-2 and 12
* @link https://github.com/mkungla/aframe-php
^ @issues https://github.com/mkungla/aframe-php/issues
* ********************************************************************
* Contributors:
* @author Marko Kungla <[email protected]>
* Comments:
* @formatter:on */
namespace AframeVR\Core\Assets;
use \AframeVR\Interfaces\Core\Assets\AssetImageInterface;
use \AframeVR\Core\Helpers\AssetsAbstract;
final class AssetImage extends AssetsAbstract implements AssetImageInterface
{
/**
* Asset constructor set asset ID
* @param string $id
*/
public function __construct(string $id)
$this->id($id);
$this->setDomElementTag('img');
}
* Set crossorigin attribute of the image
* @param string $crossorigin
* @return AssetImageInterface
public function crossorigin(string $crossorigin = 'anonymous'): AssetImageInterface
$this->attr_crossorigin = $crossorigin;
attr_crossorigin
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;
return $this;
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: