Remove outdated static sponsor list

This commit is contained in:
Claudio Zizza
2024-06-26 23:09:29 +02:00
parent 937c7136e8
commit 746f0cfa18
11 changed files with 9 additions and 303 deletions

View File

@@ -1,7 +1,6 @@
imports:
- { resource: data/partners.yml }
- { resource: data/projects.yml }
- { resource: data/sponsors.yml }
parameters:
doctrine.website.algolia.app_id: 'YVYTFT9XMW'

View File

@@ -1,74 +0,0 @@
parameters:
doctrine.website.sponsors:
-
name: 'Blackfire.io'
url: 'https://blackfire.io/'
utmParameters:
utm_source: 'doctrine'
utm_campaign: 'profiler'
utm_medium: 'sponsorship'
highlighted: true
-
name: 'SymfonyCasts'
url: 'https://symfonycasts.com/'
highlighted: true
-
name: 'Tideways'
url: 'https://tideways.com/'
highlighted: true
-
name: 'Unicorn.io'
url: 'https://unicorn.io/'
highlighted: true
-
name: 'Intracto'
url: 'https://www.intracto.com/'
highlighted: false
-
name: 'Dan Revel'
url: 'https://nopolabs.com/'
highlighted: false
-
name: 'SolidInvoice'
url: 'https://solidinvoice.co/'
highlighted: false
-
name: 'Lukasz Zelezny'
url: 'https://seo.london/'
highlighted: false
-
name: 'LEONEX'
url: 'https://www.leonex.de/'
highlighted: false
-
name: 'Tradie Training'
url: 'https://tt.edu.au/'
highlighted: false
-
name: 'whatisseo.com'
url: 'https://www.whatisseo.com/'
highlighted: false
-
name: 'Debricked'
url: 'https://debricked.com/'
highlighted: false
-
name: 'Levvvel'
url: 'https://levvvel.com/'
highlighted: false
-
name: 'joingames'
url: 'https://joingames.net/'
highlighted: false
-
name: 'OvrClock'
url: 'https://ovrclock.com/'
highlighted: false
-
name: 'SellYourPhoenixHouseFast.com'
url: 'https://www.sellyourphoenixhousefast.com'
highlighted: false
-
name: 'Scan My Kitchen'
url: 'https://scanmykitchen.com'
highlighted: false

View File

@@ -29,7 +29,6 @@ parameters:
sponsorship:
path: /sponsorship.html
controller: Doctrine\Website\Controllers\SponsorshipController::index
defaults:
title: Sponsorship
menuSlug: sponsorship

View File

@@ -111,29 +111,6 @@
<argument type="string">Doctrine\Website\Model\DoctrineUser</argument>
</service>
<service id="Doctrine\Website\Repositories\SponsorRepository" autowire="false" public="true">
<argument type="service" id="Doctrine\SkeletonMapper\ObjectManager" />
<argument type="service">
<service class="Doctrine\SkeletonMapper\DataSource\DataSourceObjectDataRepository" autowire="false">
<argument type="service" id="Doctrine\SkeletonMapper\ObjectManager" />
<argument type="service">
<service class="Doctrine\Website\DataSources\ArrayDataSource">
<argument>%doctrine.website.sponsors%</argument>
</service>
</argument>
<argument>Doctrine\Website\Model\Sponsor</argument>
</service>
</argument>
<argument type="service" id="Doctrine\SkeletonMapper\ObjectFactory" />
<argument type="service">
<service class="Doctrine\Website\Hydrators\SponsorHydrator">
<argument type="service" id="Doctrine\SkeletonMapper\ObjectManager" />
</service>
</argument>
<argument type="service" id="Doctrine\Common\EventManager" />
<argument>Doctrine\Website\Model\Sponsor</argument>
</service>
<service id="Doctrine\Website\Repositories\PartnerRepository" autowire="false" public="true">
<argument type="service" id="Doctrine\SkeletonMapper\ObjectManager" />
<argument type="service">
@@ -201,11 +178,6 @@
<argument type="service" id="Doctrine\Website\Repositories\BlogPostRepository" />
</call>
<call method="addObjectRepository">
<argument>Doctrine\Website\Model\Sponsor</argument>
<argument type="service" id="Doctrine\Website\Repositories\SponsorRepository" />
</call>
<call method="addObjectRepository">
<argument>Doctrine\Website\Model\Partner</argument>
<argument type="service" id="Doctrine\Website\Repositories\PartnerRepository" />

View File

@@ -58,7 +58,6 @@
<argument type="service" id="Doctrine\Website\Controllers\HomepageController" />
<argument type="service" id="Doctrine\Website\Controllers\PartnersController" />
<argument type="service" id="Doctrine\Website\Controllers\ProjectController" />
<argument type="service" id="Doctrine\Website\Controllers\SponsorshipController" />
<argument type="service" id="Doctrine\Website\Controllers\SitemapController" />
</argument>
</service>

View File

@@ -1,25 +0,0 @@
<?php
declare(strict_types=1);
namespace Doctrine\Website\Controllers;
use Doctrine\StaticWebsiteGenerator\Controller\Response;
use Doctrine\Website\Model\Sponsor;
use Doctrine\Website\Repositories\SponsorRepository;
final readonly class SponsorshipController
{
/** @param SponsorRepository<Sponsor> $sponsorRepository */
public function __construct(
private SponsorRepository $sponsorRepository,
) {
}
public function index(): Response
{
$sponsors = $this->sponsorRepository->findAllOrderedByHighlighted();
return new Response(['sponsors' => $sponsors]);
}
}

View File

@@ -1,46 +0,0 @@
<?php
declare(strict_types=1);
namespace Doctrine\Website\Hydrators;
use Doctrine\Website\Model\Sponsor;
use Doctrine\Website\Model\UtmParameters;
use function array_merge;
/**
* @property string $name
* @property string $url
* @property UtmParameters $utmParameters
* @property bool $highlighted
* @template-extends ModelHydrator<Sponsor>
*/
final class SponsorHydrator extends ModelHydrator
{
/** @return class-string<Sponsor> */
protected function getClassName(): string
{
return Sponsor::class;
}
/** @param mixed[] $data */
protected function doHydrate(array $data): void
{
$this->name = (string) ($data['name'] ?? '');
$this->url = (string) ($data['url'] ?? '');
$this->utmParameters = new UtmParameters(
array_merge(
[
'utm_source' => 'doctrine',
'utm_medium' => 'website',
'utm_campaign' => 'sponsors',
],
$data['utmParameters'] ?? [],
),
);
$this->highlighted = (bool) ($data['highlighted'] ?? false);
}
}

View File

@@ -1,45 +0,0 @@
<?php
declare(strict_types=1);
namespace Doctrine\Website\Model;
use Doctrine\SkeletonMapper\Mapping\ClassMetadataInterface;
use Doctrine\SkeletonMapper\Mapping\LoadMetadataInterface;
final class Sponsor implements LoadMetadataInterface
{
private string $name;
private string $url;
private UtmParameters $utmParameters;
private bool $highlighted;
public static function loadMetadata(ClassMetadataInterface $metadata): void
{
$metadata->setIdentifier(['name']);
}
public function getName(): string
{
return $this->name;
}
public function getUrl(): string
{
return $this->url;
}
/** @param string[] $parameters */
public function getUrlWithUtmParameters(array $parameters = []): string
{
return $this->utmParameters->buildUrl($this->url, $parameters);
}
public function isHighlighted(): bool
{
return $this->highlighted;
}
}

View File

@@ -1,24 +0,0 @@
<?php
declare(strict_types=1);
namespace Doctrine\Website\Repositories;
use Doctrine\SkeletonMapper\ObjectRepository\BasicObjectRepository;
use Doctrine\Website\Model\Sponsor;
/**
* @template T of Sponsor
* @template-extends BasicObjectRepository<T>
*/
class SponsorRepository extends BasicObjectRepository
{
/** @return Sponsor[] */
public function findAllOrderedByHighlighted(): array
{
/** @var Sponsor[] $sponsors */
$sponsors = $this->findBy([], ['highlighted' => 'desc']);
return $sponsors;
}
}

View File

@@ -8,33 +8,29 @@ funds for swag and travel costs when visiting conferences to support the project
This page aims to document all the ways in which you can contribute to the project financially. Of course,
if you can't contribute financially, consider `contributing with code </contribute/index.html>`_.
Our Sponsors
------------
Become a sponsor
----------------
Thanks to the following sponsors for funding Doctrine development. If you are interested in becoming a sponsor, please take a look at the Doctrine `OpenCollective page <https://opencollective.com/doctrine>`_.
Thanks to our sponsors for funding Doctrine development. If you are interested in becoming a sponsor, please take a
look at how you can support the Doctrine project:
.. raw:: html
<ul>
{% for sponsor in sponsors %}
<li><a href="{{ sponsor.urlWithUtmParameters({utm_medium:'sponsors-list'}) }}" target="_blank" rel="noopener noreferrer"{% if sponsor.highlighted %} class="font-weight-bold"{% endif %} data-ga-category="sponsors" data-ga-action="click" data-ga-label="{{ sponsor.name }}">{{ sponsor.name }}</a></li>
{% endfor %}
</ul>
* `OpenCollective <https://opencollective.com/doctrine>`_
* `GitHub sponsor <https://github.com/sponsors/doctrine>`_
OpenCollective
-------
~~~~~~~~~~~~~~
If you or your company uses Doctrine and would like to financially contribute to the project,
you can do so through our `OpenCollective <https://opencollective.com/doctrine>`_.
Corporate Sponsorships
----------------------
~~~~~~~~~~~~~~~~~~~~~~
If your company uses Doctrine and would like to financially contribute to the project, please
e-mail `sponsorship@doctrine-project.org <mailto:sponsorship@doctrine-project.org>`_ to discuss further.
Tidelift
--------
~~~~~~~~
Get professional support for Doctrine ORM through Tidelift. Available as part of the
`Tidelift Subscription <https://tidelift.com/subscription/pkg/packagist-doctrine-orm?utm_source=packagist-doctrine-orm&utm_medium=website>`_.

View File

@@ -1,45 +0,0 @@
<?php
declare(strict_types=1);
namespace Doctrine\Website\Tests\Hydrators;
use Doctrine\Website\Hydrators\SponsorHydrator;
use Doctrine\Website\Model\Sponsor;
use Doctrine\Website\Model\UtmParameters;
class SponsorHydratorTest extends Hydrators
{
public function testHydrate(): void
{
$hydrator = $this->createHydrator(SponsorHydrator::class);
$propertyValues = [
'name' => 'name',
'url' => 'url',
'highlighted' => true,
'utmParameters' => [
'utm_source' => 'utm_source',
'utm_medium' => 'utm_medium',
'utm_campaign' => 'utm_campaign',
],
];
$expected = new Sponsor();
$this->populate($expected, [
'name' => 'name',
'url' => 'url',
'highlighted' => true,
'utmParameters' => new UtmParameters([
'utm_source' => 'utm_source',
'utm_medium' => 'utm_medium',
'utm_campaign' => 'utm_campaign',
]),
]);
$sponsor = new Sponsor();
$hydrator->hydrate($sponsor, $propertyValues);
self::assertEquals($expected, $sponsor);
}
}