mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00
Add typehints and reduce code duplication
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\Media\Subdef;
|
namespace Alchemy\Phrasea\Media\Subdef;
|
||||||
|
|
||||||
|
use MediaAlchemyst\Specification\SpecificationInterface;
|
||||||
|
|
||||||
interface Subdef
|
interface Subdef
|
||||||
{
|
{
|
||||||
const TYPE_IMAGE = 'image';
|
const TYPE_IMAGE = 'image';
|
||||||
@@ -19,9 +21,20 @@ interface Subdef
|
|||||||
const TYPE_AUDIO = 'audio';
|
const TYPE_AUDIO = 'audio';
|
||||||
const TYPE_FLEXPAPER = 'flexpaper';
|
const TYPE_FLEXPAPER = 'flexpaper';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* One of Subdef Type const
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function getType();
|
public function getType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function getDescription();
|
public function getDescription();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return SpecificationInterface
|
||||||
|
*/
|
||||||
public function getMediaAlchemystSpec();
|
public function getMediaAlchemystSpec();
|
||||||
}
|
}
|
||||||
|
@@ -16,6 +16,7 @@ use Alchemy\Phrasea\Media\Subdef\FlexPaper;
|
|||||||
use Alchemy\Phrasea\Media\Subdef\Gif;
|
use Alchemy\Phrasea\Media\Subdef\Gif;
|
||||||
use Alchemy\Phrasea\Media\Subdef\Subdef as SubdefSpecs;
|
use Alchemy\Phrasea\Media\Subdef\Subdef as SubdefSpecs;
|
||||||
use Alchemy\Phrasea\Media\Type\Type as SubdefType;
|
use Alchemy\Phrasea\Media\Type\Type as SubdefType;
|
||||||
|
use MediaAlchemyst\Specification\SpecificationInterface;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class databox_subdef
|
class databox_subdef
|
||||||
@@ -268,7 +269,7 @@ class databox_subdef
|
|||||||
/**
|
/**
|
||||||
* Get the MediaAlchemyst specs for the current subdef
|
* Get the MediaAlchemyst specs for the current subdef
|
||||||
*
|
*
|
||||||
* @return type
|
* @return SpecificationInterface
|
||||||
*/
|
*/
|
||||||
public function getSpecs()
|
public function getSpecs()
|
||||||
{
|
{
|
||||||
|
@@ -395,7 +395,7 @@ class recordutils_image
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pathIn = $subdef->get_path() . $subdef->get_file();
|
$pathIn = $subdef->getRealPath();
|
||||||
|
|
||||||
if (!is_file($pathIn)) {
|
if (!is_file($pathIn)) {
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user