Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/CodeGenerator/src/Generator/ClientGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use AsyncAws\Core\AwsError\XmlAwsErrorFactory;
use AsyncAws\Core\Configuration;
use AsyncAws\Core\Exception\UnsupportedRegion;
use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\Visibility;

/**
* Generate API client.
Expand Down Expand Up @@ -252,7 +252,7 @@ public function getVersion() {

$classBuilder->addMethod('getEndpointMetadata')
->setReturnType('array')
->setVisibility(ClassType::VISIBILITY_PROTECTED)
->setVisibility(Visibility::Protected)
->setBody(strtr($body, ['"$region"' => '$region']))
->addParameter('region')
->setType('string')
Expand Down Expand Up @@ -287,7 +287,7 @@ public function getVersion() {
$errorFactoryBase = basename(str_replace('\\', '/', $errorFactory));
$classBuilder->addMethod('getAwsErrorFactory')
->setReturnType(AwsErrorFactoryInterface::class)
->setVisibility(ClassType::VISIBILITY_PROTECTED)
->setVisibility(Visibility::Protected)
->setBody("return new $errorFactoryBase();")
;

Expand Down
4 changes: 2 additions & 2 deletions src/CodeGenerator/src/Generator/EnumGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use AsyncAws\CodeGenerator\Generator\Naming\ClassName;
use AsyncAws\CodeGenerator\Generator\Naming\NamespaceRegistry;
use AsyncAws\CodeGenerator\Generator\PhpGenerator\ClassRegistry;
use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\Visibility;

/**
* Generate Enum shapeused by Input and Result classes.
Expand Down Expand Up @@ -64,7 +64,7 @@ public function generate(Shape $shape): ClassName
ksort($consts);
$availableConsts = [];
foreach ($consts as $constName => $constValue) {
$classBuilder->addConstant($constName, $constValue)->setVisibility(ClassType::VISIBILITY_PUBLIC);
$classBuilder->addConstant($constName, $constValue)->setVisibility(Visibility::Public);
$availableConsts[] = 'self::' . $constName . ' => true';
}
$classBuilder->addMethod('exists')
Expand Down
4 changes: 2 additions & 2 deletions src/CodeGenerator/src/Generator/OperationGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use AsyncAws\CodeGenerator\Generator\PhpGenerator\ClassRegistry;
use AsyncAws\Core\RequestContext;
use AsyncAws\Core\Result;
use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\Method;
use Nette\PhpGenerator\Visibility;

/**
* Generate API client methods and result classes.
Expand Down Expand Up @@ -156,7 +156,7 @@ public function generate(Operation $operation): void

if ($operation->isEndpointOperation()) {
$classBuilder->addMethod('discoverEndpoints')
->setVisibility(ClassType::VISIBILITY_PROTECTED)
->setVisibility(Visibility::Protected)
->setReturnType('array')
->setBody(strtr('
return $this->METHOD($region ? ["@region" => $region] : [])->getEndpoints();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
use AsyncAws\CodeGenerator\Generator\GeneratorHelper;
use AsyncAws\CodeGenerator\Generator\Naming\ClassName;
use AsyncAws\CodeGenerator\Generator\Naming\NamespaceRegistry;
use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\Method;
use Nette\PhpGenerator\Visibility;

/**
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
Expand Down Expand Up @@ -433,7 +433,7 @@ private function parseResponseMap(MapShape $shape, string $input, bool $required
private function createPopulateMethod(string $functionName, string $body, Shape $shape): Method
{
$method = new Method($functionName);
$method->setVisibility(ClassType::VISIBILITY_PRIVATE)
$method->setVisibility(Visibility::Private)
->setBody($body)
->addParameter('json')
->setType('array')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
use AsyncAws\CodeGenerator\Generator\GeneratorHelper;
use AsyncAws\CodeGenerator\Generator\Naming\ClassName;
use AsyncAws\CodeGenerator\Generator\Naming\NamespaceRegistry;
use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\Method;
use Nette\PhpGenerator\Visibility;

/**
* @author Jérémy Derussé <jeremy@derusse.com>
Expand Down Expand Up @@ -384,7 +384,7 @@ private function parseXmlResponseMap(MapShape $shape, string $input, bool $requi
private function createPopulateMethod(string $functionName, string $body, Shape $shape): Method
{
$method = new Method($functionName);
$method->setVisibility(ClassType::VISIBILITY_PRIVATE)
$method->setVisibility(Visibility::Private)
->setReturnType('array')
->setBody($body)
->addParameter('xml')
Expand Down
4 changes: 2 additions & 2 deletions src/CodeGenerator/src/Generator/TestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use AsyncAws\Core\Response;
use AsyncAws\Core\Test\Http\SimpleMockedResponse;
use AsyncAws\Core\Test\TestCase;
use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\Visibility;
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpClient;
Expand Down Expand Up @@ -404,7 +404,7 @@ private function createClientTestClass(ClassName $testClassName, Operation $oper

$classBuilder->setExtends(TestCase::class);
$classBuilder->addMethod('getClient')
->setVisibility(ClassType::VISIBILITY_PRIVATE)
->setVisibility(Visibility::Private)
->setReturnType($clientClassName->getFqdn())
->setBody(strtr('
MARKER
Expand Down
8 changes: 4 additions & 4 deletions src/CodeGenerator/src/Generator/WaiterGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use AsyncAws\Core\Response;
use AsyncAws\Core\Result;
use AsyncAws\Core\Waiter as WaiterResult;
use Nette\PhpGenerator\ClassType;
use Nette\PhpGenerator\Visibility;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
Expand Down Expand Up @@ -143,9 +143,9 @@ private function generateWaiterResult(Waiter $waiter): ClassName
$classBuilder = $this->classRegistry->register($className->getFqdn());

$classBuilder->addConstant('WAIT_TIMEOUT', (float) ($waiter->getMaxAttempts() * $waiter->getDelay()))
->setVisibility(ClassType::VISIBILITY_PROTECTED);
->setVisibility(Visibility::Protected);
$classBuilder->addConstant('WAIT_DELAY', (float) $waiter->getDelay())
->setVisibility(ClassType::VISIBILITY_PROTECTED);
->setVisibility(Visibility::Protected);

$classBuilder->addUse(WaiterResult::class);
$classBuilder->addUse(Result::class);
Expand All @@ -162,7 +162,7 @@ private function generateWaiterResult(Waiter $waiter): ClassName

$classBuilder->addMethod('refreshState')
->setReturnType(WaiterResult::class)
->setVisibility(ClassType::VISIBILITY_PROTECTED)
->setVisibility(Visibility::Protected)
->setBody(strtr('
if (!$this->awsClient instanceOf CLIENT_CLASSNAME) {
throw new InvalidArgument(\'missing client injected in waiter result\');
Expand Down
Loading