Code Duplication    Length = 8-8 lines in 2 locations

core/domain/DomainFactory.php 1 location

@@ 78-85 (lines=8) @@
75
    private static function getDomain($fqcn, array $arguments)
76
    {
77
        if (! isset(DomainFactory::$domains[ $fqcn ])) {
78
            if (! isset($arguments[0], $arguments[1])) {
79
                throw new InvalidArgumentException(
80
                    esc_html__(
81
                        'You need to pass at least two arguments, representing the addon plugin file and version, in order to generate a Domain class',
82
                        'event_espresso'
83
                    )
84
                );
85
            }
86
            $filepath = $arguments[0] instanceof FilePath ? $arguments[0] : new FilePath($arguments[0]);
87
            $version  = $arguments[1] instanceof Version ? $arguments[1] : Version::fromString($arguments[1]);
88
            $domain   = new $fqcn($filepath, $version);

core/services/assets/AssetManifestFactory.php 1 location

@@ 62-69 (lines=8) @@
59
     */
60
    public function create($fqcn, array $arguments = [])
61
    {
62
        if (! isset($arguments[0]) || ! $arguments[0] instanceof DomainInterface) {
63
            throw new InvalidArgumentException(
64
                esc_html__(
65
                    'In order to generate an AssetManifest class you need to supply an array where the first argument is an instance of DomainInterface.',
66
                    'event_espresso'
67
                )
68
            );
69
        }
70
        return $this->getAssetManifestForDomain($fqcn, $arguments[0]);
71
    }
72