Skip to content

Commit c55bbd7

Browse files
feat(php): rename internal types
1 parent c38da93 commit c55bbd7

File tree

47 files changed

+111
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+111
-124
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $completedSmartscraper = $client->smartscraper->create(
5959
var_dump($completedSmartscraper->request_id);
6060
```
6161

62-
## Value Objects
62+
### Value Objects
6363

6464
It is recommended to use the static `with` constructor `Dog::with(name: "Joey")`
6565
and named parameters to initialize value objects.

src/Core/Concerns/Page.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/Core/Concerns/Enum.php renamed to src/Core/Concerns/SdkEnum.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
use Scrapegraphai\Core\Conversion\Contracts\Converter;
88
use Scrapegraphai\Core\Conversion\EnumOf;
99

10-
trait Enum
10+
/**
11+
* @internal
12+
*/
13+
trait SdkEnum
1114
{
1215
private static Converter $converter;
1316

src/Core/Concerns/Model.php renamed to src/Core/Concerns/SdkModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* @internal
1616
*/
17-
trait Model
17+
trait SdkModel
1818
{
1919
private static ModelOf $converter;
2020

src/Core/Concerns/Params.php renamed to src/Core/Concerns/SdkParams.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* @internal
1313
*/
14-
trait Params
14+
trait SdkParams
1515
{
1616
/**
1717
* @param null|array<string, mixed>|self $params

src/Core/Concerns/Union.php renamed to src/Core/Concerns/SdkUnion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* @internal
1313
*/
14-
trait Union
14+
trait SdkUnion
1515
{
1616
private static Converter $converter;
1717

src/Core/Contracts/BasePage.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44

55
namespace Scrapegraphai\Core\Contracts;
66

7+
use Psr\Http\Message\ResponseInterface;
8+
use Scrapegraphai\Core\BaseClient;
9+
use Scrapegraphai\Core\Pagination\PageRequestOptions;
10+
711
/**
812
* @internal
913
*/
10-
interface BasePage extends \Stringable
14+
interface BasePage
1115
{
12-
/**
13-
* @return \Traversable<mixed>
14-
*/
15-
public function pagingEachItem(): \Traversable;
16+
public function __construct(
17+
BaseClient $client,
18+
PageRequestOptions $options,
19+
ResponseInterface $response,
20+
mixed $body,
21+
);
1622
}

src/Core/Pagination/AbstractPage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Psr\Http\Message\ResponseInterface;
88
use Scrapegraphai\Core\BaseClient;
9-
use Scrapegraphai\Core\Concerns\Page;
9+
use Scrapegraphai\Core\Contracts\BasePage;
1010
use Scrapegraphai\Errors\Error;
1111

1212
/**
@@ -16,7 +16,7 @@
1616
*
1717
* @implements \IteratorAggregate<Item>
1818
*/
19-
abstract class AbstractPage implements \IteratorAggregate, Page
19+
abstract class AbstractPage implements \IteratorAggregate, BasePage
2020
{
2121
public function __construct(
2222
protected BaseClient $client,

src/Crawl/CrawlStartParams.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace Scrapegraphai\Crawl;
66

77
use Scrapegraphai\Core\Attributes\Api;
8-
use Scrapegraphai\Core\Concerns\Model;
9-
use Scrapegraphai\Core\Concerns\Params;
8+
use Scrapegraphai\Core\Concerns\SdkModel;
9+
use Scrapegraphai\Core\Concerns\SdkParams;
1010
use Scrapegraphai\Core\Contracts\BaseModel;
1111
use Scrapegraphai\Crawl\CrawlStartParams\Rules;
1212

@@ -29,8 +29,8 @@
2929
*/
3030
final class CrawlStartParams implements BaseModel
3131
{
32-
use Model;
33-
use Params;
32+
use SdkModel;
33+
use SdkParams;
3434

3535
/**
3636
* Starting URL for crawling.

src/Crawl/CrawlStartParams/Rules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Scrapegraphai\Crawl\CrawlStartParams;
66

77
use Scrapegraphai\Core\Attributes\Api;
8-
use Scrapegraphai\Core\Concerns\Model;
8+
use Scrapegraphai\Core\Concerns\SdkModel;
99
use Scrapegraphai\Core\Contracts\BaseModel;
1010
use Scrapegraphai\Core\Conversion\ListOf;
1111

@@ -14,7 +14,7 @@
1414
*/
1515
final class Rules implements BaseModel
1616
{
17-
use Model;
17+
use SdkModel;
1818

1919
/**
2020
* URL patterns to exclude from crawling.

0 commit comments

Comments
 (0)