gordonbanderson /
ss3gallery
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | class ImageMetaDataExtensionTest extends TestWithImage |
||
|
0 ignored issues
–
show
|
|||
| 4 | { |
||
| 5 | protected static $fixture_file = 'ss3gallery/tests/ss3gallery.yml'; |
||
| 6 | |||
| 7 | public function testProcessExifData() |
||
| 8 | { |
||
| 9 | $gi = new GalleryImage(); |
||
| 10 | $gi->Title = 'Gallery Image Example'; |
||
|
0 ignored issues
–
show
The property
Title does not exist on object<GalleryImage>. Since you implemented __set, maybe consider adding a @property annotation.
Since your code implements the magic setter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
Since the property has write access only, you can use the @property-write annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 11 | $image = Image::get()->filter('Title', 'Test Image')->first(); |
||
| 12 | $this->assertEquals('assets/TestImageSS3Gallery/test.jpg', $image->Filename); |
||
|
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 13 | $gi->ImageID = $image->ID; |
||
|
0 ignored issues
–
show
The property
ImageID does not exist on object<GalleryImage>. Since you implemented __set, maybe consider adding a @property annotation.
Since your code implements the magic setter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
Since the property has write access only, you can use the @property-write annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 14 | //This will trigger processExifData method |
||
| 15 | $gi->write(); |
||
| 16 | |||
| 17 | $this->assertTrue($gi->ExifRead); |
||
|
0 ignored issues
–
show
The property
ExifRead does not exist on object<GalleryImage>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
The method
assertTrue() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 18 | $this->assertEquals('2.4', $gi->Aperture); |
||
|
0 ignored issues
–
show
The property
Aperture does not exist on object<GalleryImage>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 19 | $this->assertEquals('10/160', $gi->ShutterSpeed); |
||
|
0 ignored issues
–
show
The property
ShutterSpeed does not exist on object<GalleryImage>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 20 | $this->assertEquals(400, $gi->ISO); |
||
|
0 ignored issues
–
show
The property
ISO does not exist on object<GalleryImage>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 21 | $this->assertEquals('2015:09:19 17:40:54', $gi->TakenAt); |
||
|
0 ignored issues
–
show
The property
TakenAt does not exist on object<GalleryImage>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 22 | $this->assertEquals(Image::ORIENTATION_PORTRAIT, $gi->Orientation); |
||
|
0 ignored issues
–
show
The property
Orientation does not exist on object<GalleryImage>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 23 | $this->assertEquals(13.860741666667, $gi->Lat); |
||
|
0 ignored issues
–
show
The property
Lat does not exist on object<GalleryImage>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 24 | $this->assertEquals(100.44168916667, $gi->Lon); |
||
|
0 ignored issues
–
show
The property
Lon does not exist on object<GalleryImage>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 25 | } |
||
| 26 | |||
| 27 | public function testRequireDefaultRecords() |
||
| 28 | { |
||
| 29 | // Reset using SQL, otherwise SS triggers a re-read of the exif data |
||
| 30 | DB::query('UPDATE "GalleryImage" SET "ExifRead" = 0'); |
||
| 31 | DB::query('UPDATE "GalleryImage" SET "Lon" = 0'); |
||
| 32 | DB::query('UPDATE "GalleryImage" SET "Lat" = 0'); |
||
| 33 | |||
| 34 | $image = new GalleryImage(); |
||
| 35 | $image->requireDefaultRecords(); |
||
| 36 | |||
| 37 | // all images point to the same image file so can assert same details |
||
| 38 | foreach (GalleryImage::get() as $gi) { |
||
| 39 | $this->assertEquals(1, $gi->ExifRead); |
||
|
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 40 | $this->assertEquals('2.4', $gi->Aperture); |
||
|
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 41 | $this->assertEquals('10/160', $gi->ShutterSpeed); |
||
|
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 42 | $this->assertEquals(400, $gi->ISO); |
||
|
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 43 | $this->assertEquals('2015-09-19 17:40:54', $gi->TakenAt); |
||
|
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 44 | $this->assertEquals(Image::ORIENTATION_PORTRAIT, $gi->Orientation); |
||
|
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 45 | $this->assertEquals(13.860741666667, $gi->Lat); |
||
|
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 46 | $this->assertEquals(100.44168916667, $gi->Lon); |
||
|
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 47 | } |
||
| 48 | |||
| 49 | $this->assertEquals(4, GalleryImage::get()->count()); |
||
|
0 ignored issues
–
show
The method
assertEquals() does not seem to exist on object<ImageMetaDataExtensionTest>.
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||
| 50 | } |
||
| 51 | |||
| 52 | } |
||
| 53 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.