Skip to content

Commit

Permalink
Change the namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Meerwaldt committed Mar 12, 2020
1 parent e95412b commit 47d32de
Show file tree
Hide file tree
Showing 30 changed files with 69 additions and 71 deletions.
2 changes: 1 addition & 1 deletion src/generators/breadcrumbs-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Models\Indexable;
use Yoast\WP\SEO\Presentations\Generators\Generator_Interface;
use Yoast\WP\SEO\Generators\Generator_Interface;
use Yoast\WP\SEO\Repositories\Indexable_Repository;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/generators/generator-interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators
* @package Yoast\WP\SEO\Generators
*/

namespace Yoast\WP\SEO\Presentations\Generators;
namespace Yoast\WP\SEO\Generators;

use Yoast\WP\SEO\Context\Meta_Tags_Context;

Expand Down
2 changes: 1 addition & 1 deletion src/generators/open-graph-image-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\Url_Helper;
use Yoast\WP\SEO\Models\Indexable;
use Yoast\WP\SEO\Presentations\Generators\Generator_Interface;
use Yoast\WP\SEO\Generators\Generator_Interface;
use Yoast\WP\SEO\Values\Open_Graph\Images;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/generators/open-graph-locale-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators
* @package Yoast\WP\SEO\Generators
*/

namespace Yoast\WP\SEO\Presentations\Generators;
namespace Yoast\WP\SEO\Generators;

use Yoast\WP\SEO\Context\Meta_Tags_Context;

Expand Down
10 changes: 4 additions & 6 deletions src/generators/schema-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators
* @package Yoast\WP\SEO\Generators
*/

namespace Yoast\WP\SEO\Presentations\Generators;
namespace Yoast\WP\SEO\Generators;

use WP_Block_Parser_Block;
use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Current_Page_Helper;
use Yoast\WP\SEO\Helpers\Schema\ID_Helper;
use Yoast\WP\SEO\Presentations\Generators\Schema\Abstract_Schema_Piece;
use Yoast\WP\SEO\Generators\Schema\Abstract_Schema_Piece;

/**
* Class Schema_Generator
*
* @package Yoast\WP\SEO\Presentations\Generators
*/
class Schema_Generator implements Generator_Interface {

Expand Down Expand Up @@ -113,7 +111,7 @@ public function generate( Meta_Tags_Context $context ) {

$pieces_to_generate = [];
foreach ( $pieces as $piece ) {
$identifier = \strtolower( \str_replace( 'Yoast\WP\SEO\Presentations\Generators\Schema\\', '', \get_class( $piece ) ) );
$identifier = \strtolower( \str_replace( 'Yoast\WP\SEO\Generators\Schema\\', '', \get_class( $piece ) ) );
if ( property_exists( $piece, 'identifier' ) ) {
$identifier = $piece->identifier;
}
Expand Down
8 changes: 3 additions & 5 deletions src/generators/schema/abstract-schema-piece.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Schema\ID_Helper;
use Yoast\WP\SEO\Presentations\Generators\Generator_Interface;
use Yoast\WP\SEO\Generators\Generator_Interface;

/**
* Class Abstract_Schema_Piece
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
*/
abstract class Abstract_Schema_Piece implements Generator_Interface {

Expand Down
4 changes: 2 additions & 2 deletions src/generators/schema/article.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Date_Helper;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/schema/author.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Image_Helper;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/schema/breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Current_Page_Helper;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/schema/faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Schema\HTML_Helper;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/schema/howto.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Schema\HTML_Helper;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/schema/main-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Image_Helper;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/schema/organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Options_Helper;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/schema/person.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Image_Helper;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/schema/webpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use WP_Post;
use Yoast\WP\SEO\Context\Meta_Tags_Context;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/schema/website.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* WPSEO plugin file.
*
* @package Yoast\WP\SEO\Presentations\Generators\Schema
* @package Yoast\WP\SEO\Generators\Schema
*/

namespace Yoast\WP\SEO\Presentations\Generators\Schema;
namespace Yoast\WP\SEO\Generators\Schema;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Helpers\Options_Helper;
Expand Down
2 changes: 1 addition & 1 deletion src/generators/twitter-image-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Yoast\WP\SEO\Helpers\Twitter\Image_Helper as Twitter_Image_Helper;
use Yoast\WP\SEO\Helpers\Url_Helper;
use Yoast\WP\SEO\Models\Indexable;
use Yoast\WP\SEO\Presentations\Generators\Generator_Interface;
use Yoast\WP\SEO\Generators\Generator_Interface;
use Yoast\WP\SEO\Values\Images;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/presentations/indexable-presentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
use Yoast\WP\SEO\Helpers\Url_Helper;
use Yoast\WP\SEO\Helpers\User_Helper;
use Yoast\WP\SEO\Models\Indexable;
use Yoast\WP\SEO\Presentations\Generators\Open_Graph_Locale_Generator;
use Yoast\WP\SEO\Presentations\Generators\Schema_Generator;
use Yoast\WP\SEO\Generators\Open_Graph_Locale_Generator;
use Yoast\WP\SEO\Generators\Schema_Generator;

/**
* Class Indexable_Presentation
Expand Down
2 changes: 1 addition & 1 deletion tests/_mocks/author.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Yoast\WP\SEO\Context\Meta_Tags_Context as Meta_Tags_Context_Original;

class Author extends \Yoast\WP\SEO\Presentations\Generators\Schema\Author {
class Author extends \Yoast\WP\SEO\Generators\Schema\Author {

/**
* @inheritDoc
Expand Down
2 changes: 1 addition & 1 deletion tests/doubles/generators/schema/article-double.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Yoast\WP\SEO\Tests\Doubles;

use Yoast\WP\SEO\Context\Meta_Tags_Context;
use Yoast\WP\SEO\Presentations\Generators\Schema\Article;
use Yoast\WP\SEO\Generators\Schema\Article;

/**
* Class Article_Double.
Expand Down
4 changes: 2 additions & 2 deletions tests/generators/open-graph-locale-generator-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

use Brain\Monkey;
use Mockery;
use Yoast\WP\SEO\Presentations\Generators\Open_Graph_Locale_Generator;
use Yoast\WP\SEO\Generators\Open_Graph_Locale_Generator;
use Yoast\WP\SEO\Tests\Mocks\Meta_Tags_Context;
use Yoast\WP\SEO\Tests\TestCase;

/**
* Class Open_Graph_Locale_Generator_Test
*
* @coversDefaultClass \Yoast\WP\SEO\Presentations\Generators\Open_Graph_Locale_Generator
* @coversDefaultClass \Yoast\WP\SEO\Generators\Open_Graph_Locale_Generator
*
* @group generators
* @group open-graph
Expand Down
24 changes: 12 additions & 12 deletions tests/generators/schema-generator-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
namespace Yoast\WP\SEO\Tests\Generators;

use Mockery;
use Yoast\WP\SEO\Presentations\Generators\Schema_Generator;
use Yoast\WP\SEO\Generators\Schema_Generator;
use Yoast\WP\SEO\Tests\Mocks\Meta_Tags_Context;
use Yoast\WP\SEO\Tests\TestCase;
use Yoast\WP\SEO\Helpers\Schema\ID_Helper;
use Yoast\WP\SEO\Helpers\Current_Page_Helper;
use Yoast\WP\SEO\Presentations\Generators\Schema\Organization;
use Yoast\WP\SEO\Presentations\Generators\Schema\Person;
use Yoast\WP\SEO\Presentations\Generators\Schema\Website;
use Yoast\WP\SEO\Presentations\Generators\Schema\Main_Image;
use Yoast\WP\SEO\Presentations\Generators\Schema\WebPage;
use Yoast\WP\SEO\Presentations\Generators\Schema\Breadcrumb;
use Yoast\WP\SEO\Presentations\Generators\Schema\Article;
use Yoast\WP\SEO\Presentations\Generators\Schema\Author;
use Yoast\WP\SEO\Presentations\Generators\Schema\FAQ;
use Yoast\WP\SEO\Presentations\Generators\Schema\HowTo;
use Yoast\WP\SEO\Generators\Schema\Organization;
use Yoast\WP\SEO\Generators\Schema\Person;
use Yoast\WP\SEO\Generators\Schema\Website;
use Yoast\WP\SEO\Generators\Schema\Main_Image;
use Yoast\WP\SEO\Generators\Schema\WebPage;
use Yoast\WP\SEO\Generators\Schema\Breadcrumb;
use Yoast\WP\SEO\Generators\Schema\Article;
use Yoast\WP\SEO\Generators\Schema\Author;
use Yoast\WP\SEO\Generators\Schema\FAQ;
use Yoast\WP\SEO\Generators\Schema\HowTo;

/**
* Class Schema_Generator_Test
*
* @coversDefaultClass \Yoast\WP\SEO\Presentations\Generators\Schema_Generator
* @coversDefaultClass \Yoast\WP\SEO\Generators\Schema_Generator
*
* @group generators
* @group schema
Expand Down
4 changes: 2 additions & 2 deletions tests/generators/schema/article-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Yoast\WP\SEO\Helpers\Schema\ID_Helper;
use Yoast\WP\SEO\Helpers\Schema\HTML_Helper;
use Yoast\WP\SEO\Helpers\Schema\Language_Helper;
use Yoast\WP\SEO\Presentations\Generators\Schema\Article;
use Yoast\WP\SEO\Generators\Schema\Article;
use Yoast\WP\SEO\Tests\Doubles\Article_Double;
use Yoast\WP\SEO\Tests\Mocks\Indexable;
use Yoast\WP\SEO\Tests\Mocks\Meta_Tags_Context;
Expand All @@ -23,7 +23,7 @@
* @group generators
* @group schema
*
* @coversDefaultClass \Yoast\WP\SEO\Presentations\Generators\Schema\Article
* @coversDefaultClass \Yoast\WP\SEO\Generators\Schema\Article
* @covers ::<!public>
*/
class Article_Test extends TestCase {
Expand Down
2 changes: 1 addition & 1 deletion tests/generators/schema/author-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @group generators
* @group schema
*
* @coversDefaultClass \Yoast\WP\SEO\Presentations\Generators\Schema\Author
* @coversDefaultClass \Yoast\WP\SEO\Generators\Schema\Author
*/
class Author_Test extends TestCase {
/**
Expand Down
6 changes: 4 additions & 2 deletions tests/generators/schema/breadcrumb-test.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

namespace Yoast\WP\SEO\Tests\Generators\Schema;

use Mockery;
use Yoast\WP\SEO\Helpers\Current_Page_Helper;
use Yoast\WP\SEO\Helpers\Schema\ID_Helper;
use Yoast\WP\SEO\Presentations\Generators\Schema\Breadcrumb;
use Yoast\WP\SEO\Generators\Schema\Breadcrumb;
use Yoast\WP\SEO\Presentations\Indexable_Presentation;
use Yoast\WP\SEO\Tests\Mocks\Indexable;
use Yoast\WP\SEO\Tests\Mocks\Meta_Tags_Context;
Expand All @@ -15,7 +17,7 @@
* @group generators
* @group schema
*
* @coversDefaultClass \Yoast\WP\SEO\Presentations\Generators\Schema\Breadcrumb
* @coversDefaultClass \Yoast\WP\SEO\Generators\Schema\Breadcrumb
*/
class Breadcrumb_Test extends TestCase {

Expand Down
4 changes: 2 additions & 2 deletions tests/generators/schema/faq-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Yoast\WP\SEO\Helpers\Schema\HTML_Helper;
use Yoast\WP\SEO\Helpers\Schema\Language_Helper;
use Yoast\WP\SEO\Presentations\Generators\Schema\FAQ;
use Yoast\WP\SEO\Generators\Schema\FAQ;
use Yoast\WP\SEO\Tests\Mocks\Meta_Tags_Context;
use Yoast\WP\SEO\Tests\TestCase;

Expand All @@ -14,7 +14,7 @@
* @group generators
* @group schema
*
* @coversDefaultClass Yoast\WP\SEO\Presentations\Generators\Schema\FAQ
* @coversDefaultClass Yoast\WP\SEO\Generators\Schema\FAQ
*/
class FAQ_Test extends TestCase {

Expand Down
Loading

0 comments on commit 47d32de

Please sign in to comment.