diff --git a/composer.json b/composer.json index c2f012d..7a0fcd4 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "symfony/maker-bundle": "^1.26", "symfony/twig-bundle": "5.2.*", "symfony/yaml": "5.2.*", + "tightenco/collect": "^8.19", "twig/extra-bundle": "^2.12|^3.0", "twig/twig": "^2.12|^3.0" }, diff --git a/composer.lock b/composer.lock index 983b431..c252258 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "78370320905a72a021718c801ce79a79", + "content-hash": "4bd1788348537b838b512b44b6eda8e4", "packages": [ { "name": "doctrine/annotations", @@ -3135,6 +3135,56 @@ ], "time": "2020-12-08T17:02:38+00:00" }, + { + "name": "tightenco/collect", + "version": "v8.19.0", + "source": { + "type": "git", + "url": "https://github.com/tighten/collect.git", + "reference": "0c0243a0dc0b66f54d0ec409f36cd9889665b132" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tighten/collect/zipball/0c0243a0dc0b66f54d0ec409f36cd9889665b132", + "reference": "0c0243a0dc0b66f54d0ec409f36cd9889665b132", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "nesbot/carbon": "^2.23.0", + "phpunit/phpunit": "^8.3" + }, + "type": "library", + "autoload": { + "files": [ + "src/Collect/Support/helpers.php", + "src/Collect/Support/alias.php" + ], + "psr-4": { + "Tightenco\\Collect\\": "src/Collect" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "Collect - Illuminate Collections as a separate package.", + "keywords": [ + "collection", + "laravel" + ], + "time": "2020-12-19T00:06:29+00:00" + }, { "name": "twig/extra-bundle", "version": "v3.1.1", diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index c9409a4..b782ab3 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -2,3 +2,4 @@ twig: default_path: '%kernel.project_dir%/templates' globals: menu_items: '@App\Repository\MenuItemRepository' + sponsors: '@App\Repository\SponsorRepository' diff --git a/src/Collection/SponsorCollection.php b/src/Collection/SponsorCollection.php new file mode 100644 index 0000000..87f3700 --- /dev/null +++ b/src/Collection/SponsorCollection.php @@ -0,0 +1,17 @@ +filter(function (array $sponsor) use ($type): bool { + return $sponsor['type'] == $type; + }); + } +} diff --git a/src/Repository/SponsorArrayRepository.php b/src/Repository/SponsorArrayRepository.php new file mode 100644 index 0000000..8574729 --- /dev/null +++ b/src/Repository/SponsorArrayRepository.php @@ -0,0 +1,111 @@ + 'DDEV', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/ddev1000.png', + 'type' => self::TYPE_PLATINUM, + ], + [ + 'name' => 'Acquia', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/Acquia_no_tagline.png', + 'type' => self::TYPE_GOLD, + ], + [ + 'name' => 'Palantir.net', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/palantir-logo_0.png', + 'type' => self::TYPE_GOLD, + ], + [ + 'name' => 'Drupal Contractors, by esteemed', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/dcont-logo-v1-stacked-black-01.png', + 'type' => self::TYPE_GOLD, + ], + [ + 'name' => 'Lullabot', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/lullabot.jpg', + 'type' => self::TYPE_GOLD, + ], + [ + 'name' => 'Florida Realtors Association', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/florida-realtors-logo.png', + 'type' => self::TYPE_SILVER, + ], + [ + 'name' => 'DrupalEasy', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/DrupalEasy%20CMYK%20Layered_0.png', + 'type' => self::TYPE_SILVER, + ], + [ + 'name' => 'Specbee', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/SpecbeeLogo-800x800.png', + 'type' => self::TYPE_SILVER, + ], + [ + 'name' => 'devPanel', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/logo_devPanel_800x800_3.png', + 'type' => self::TYPE_BRONZE, + ], + [ + 'name' => 'Promet Source', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/Promet_Logo_Master-04.png', + 'type' => self::TYPE_BRONZE, + ], + [ + 'name' => 'Hot Sauce', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/hotsauce_logo.png', + 'type' => self::TYPE_BRONZE, + ], + [ + 'name' => 'CLoud NYNE Design', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/CLoud-NYNE-Design.jpg', + 'type' => self::TYPE_BRONZE, + ], + [ + 'name' => 'Bluehorn Digital', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/Bluehorn%20Digital%20Logo%20-%204C.png', + 'type' => self::TYPE_BRONZE, + ], + [ + 'name' => 'Pantheon', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/newlogo-webops_New%20logo%20-black%20fist%20tagline.png', + 'type' => self::TYPE_BRONZE, + ], + [ + 'name' => 'DesignHammer', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/DesignHammer%20%281%29.png', + 'type' => self::TYPE_BRONZE, + ], + [ + 'name' => 'The Weekly Drop', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/twd-square-logo.png', + 'type' => self::TYPE_IN_KIND, + ], + [ + 'name' => 'Kanopi Studios', + 'logo_url' => 'https://www.fldrupal.camp/sites/default/files/styles/medium/public/Kanopi_Logo_Horiz_RGB.png', + 'type' => self::TYPE_IN_KIND, + ] + ]; + + public function findByType(string $type): array + { + $sponsors = new SponsorCollection(self::SPONSORS); + + return $sponsors->byType($type)->toArray(); + } +} diff --git a/src/Repository/SponsorRepository.php b/src/Repository/SponsorRepository.php new file mode 100644 index 0000000..0cdb48c --- /dev/null +++ b/src/Repository/SponsorRepository.php @@ -0,0 +1,8 @@ + +
{{ sponsor.name }}
+ +