Skip to content

Commit d419fa8

Browse files
authored
fix autoloading issue for dialogflow and removes whitespace (GoogleCloudPlatform#977)
1 parent f29afb4 commit d419fa8

12 files changed

+24
-26
lines changed

dialogflow/composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
"google/cloud-core": "^1.20"
3030
},
3131
"autoload-dev": {
32-
"files": [
33-
"test/DialogflowTestTrait.php"
34-
]
32+
"psr-4": {"Google\\Cloud\\Samples\\Dialogflow\\": "test/"}
3533
}
3634
}

dialogflow/dialogflow.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
'Text inputs.')
4242
->setDescription('Detect intent of text inputs using Dialogflow.')
4343
->setHelp(<<
44-
The %command.name% command detects the intent of provided text
44+
The %command.name% command detects the intent of provided text
4545
using Dialogflow.
4646
47-
php %command.full_name% PROJECT_ID [-s SESSION_ID]
47+
php %command.full_name% PROJECT_ID [-s SESSION_ID]
4848
[-l LANGUAGE-CODE] text [texts ...]
4949
EOF
5050
)
@@ -68,10 +68,10 @@
6868
->addArgument('path', InputArgument::REQUIRED, 'Path to audio file.')
6969
->setDescription('Detect intent of audio file using Dialogflow.')
7070
->setHelp(<<
71-
The %command.name% command detects the intent of provided audio
71+
The %command.name% command detects the intent of provided audio
7272
using Dialogflow.
7373
74-
php %command.full_name% PROJECT_ID [-s SESSION_ID]
74+
php %command.full_name% PROJECT_ID [-s SESSION_ID]
7575
[-l LANGUAGE-CODE] AUDIO_FILE_PATH
7676
EOF
7777
)
@@ -95,10 +95,10 @@
9595
->addArgument('path', InputArgument::REQUIRED, 'Path to audio file.')
9696
->setDescription('Detect intent of audio stream using Dialogflow.')
9797
->setHelp(<<
98-
The %command.name% command detects the intent of provided text
98+
The %command.name% command detects the intent of provided text
9999
using Dialogflow.
100100
101-
php %command.full_name% PROJECT_ID -s SESSION_ID
101+
php %command.full_name% PROJECT_ID -s SESSION_ID
102102
-l LANGUAGE-CODE AUDIO_FILE_PATH
103103
EOF
104104
)
@@ -143,7 +143,7 @@
143143
->setHelp(<<
144144
The %command.name% command creates intent of provided display name.
145145
146-
php %command.full_name% PROJECT_ID DISPLAY_NAME -t training_phrase_part
146+
php %command.full_name% PROJECT_ID DISPLAY_NAME -t training_phrase_part
147147
[-t trainining_phrase_part ...] -m message_text [-m message_text ...]
148148
EOF
149149
)
@@ -331,7 +331,7 @@
331331
->setHelp(<<
332332
The %command.name% command creates context of provided context id.
333333
334-
php %command.full_name% PROJECT_ID -s SESSION_ID CONTEXT_ID
334+
php %command.full_name% PROJECT_ID -s SESSION_ID CONTEXT_ID
335335
-c LIFESPAN_COUNT
336336
EOF
337337
)
@@ -401,11 +401,11 @@
401401
SessionEntityType_EntityOverrideMode::ENTITY_OVERRIDE_MODE_OVERRIDE)
402402
->setDescription('Create session entity type.')
403403
->setHelp(<<
404-
The %command.name% command creates session entity type with
404+
The %command.name% command creates session entity type with
405405
display name and values provided.
406406
407-
php %command.full_name% PROJECT_ID -s SESSION_ID
408-
ENTITY_TYPE_DISPLAY_NAME entity_value [entity_values ...]
407+
php %command.full_name% PROJECT_ID -s SESSION_ID
408+
ENTITY_TYPE_DISPLAY_NAME entity_value [entity_values ...]
409409
-o ENTITY_OVERRIDE_MODE
410410
EOF
411411
)
@@ -432,7 +432,7 @@
432432
->setHelp(<<
433433
The %command.name% command deletes specified session entity type.
434434
435-
php %command.full_name% PROJECT_ID SESSION_ID
435+
php %command.full_name% PROJECT_ID SESSION_ID
436436
ENTITY_TYPE_DISPLAY_NAME
437437
EOF
438438
)

dialogflow/src/context_create.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ function context_create($projectId, $contextId, $sessionId, $lifespan = 1)
3131
$context = new Context();
3232
$context->setName($contextName);
3333
$context->setLifespanCount($lifespan);
34-
34+
3535
// create context
3636
$response = $contextsClient->createContext($parent, $context);
3737
printf('Context created: %s' . PHP_EOL, $response->getName());
38-
38+
3939
$contextsClient->close();
4040
}
4141
// [END dialogflow_create_context]

dialogflow/src/context_delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
function context_delete($projectId, $contextId, $sessionId)
2424
{
2525
$contextsClient = new ContextsClient();
26-
26+
2727
$contextName = $contextsClient->contextName($projectId, $sessionId,
2828
$contextId);
2929
$contextsClient->deleteContext($contextName);

dialogflow/src/detect_intent_texts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function detect_intent_texts($projectId, $texts, $sessionId, $languageCode = 'en
6262
print(PHP_EOL);
6363
printf('Fulfilment text: %s' . PHP_EOL, $fulfilmentText);
6464
}
65-
65+
6666
$sessionsClient->close();
6767
}
6868
// [END dialogflow_detect_intent_text]

dialogflow/src/entity_delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
function entity_delete($projectId, $entityTypeId, $entityValue)
2727
{
2828
$entityTypesClient = new EntityTypesClient();
29-
29+
3030
$parent = $entityTypesClient->entityTypeName($projectId,
3131
$entityTypeId);
3232
$entityTypesClient->batchDeleteEntities($parent, [$entityValue]);

dialogflow/src/entity_list.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function entity_list($projectId, $entityTypeId)
2828
$parent = $entityTypesClient->entityTypeName($projectId,
2929
$entityTypeId);
3030
$entityType = $entityTypesClient->getEntityType($parent);
31-
31+
3232
// get entities
3333
$entities = $entityType->getEntities();
3434
foreach ($entities as $entity) {

dialogflow/src/entity_type_create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
function entity_type_create($projectId, $displayName, $kind = EntityType_Kind::KIND_MAP)
2929
{
3030
$entityTypesClient = new EntityTypesClient();
31-
31+
3232
// prepare entity type
3333
$parent = $entityTypesClient->projectAgentName($projectId);
3434
$entityType = new EntityType();

dialogflow/src/entity_type_delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function entity_type_delete($projectId, $entityTypeId)
3131
$entityTypeId);
3232
$entityTypesClient->deleteEntityType($parent);
3333
printf('Entity type deleted: %s' . PHP_EOL, $parent);
34-
34+
3535
$entityTypesClient->close();
3636
}
3737
// [END dialogflow_delete_entity_type]

dialogflow/src/intent_delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function intent_delete($projectId, $intentId)
3030

3131
$intentsClient->deleteIntent($intentName);
3232
printf('Intent deleted: %s' . PHP_EOL, $intentName);
33-
33+
3434
$intentsClient->close();
3535
}
3636
// [END dialogflow_delete_intent]

dialogflow/src/session_entity_type_create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function session_entity_type_create($projectId, $displayName, $values,
3535
// prepare name
3636
$sessionEntityTypeName = $sessionEntityTypesClient
3737
->sessionEntityTypeName($projectId, $sessionId, $displayName);
38-
38+
3939
// prepare entities
4040
$entities = [];
4141
foreach ($values as $value) {

dialogflow/src/session_entity_type_delete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
function session_entity_type_delete($projectId, $displayName, $sessionId)
2727
{
2828
$sessionEntityTypesClient = new SessionEntityTypesClient();
29-
29+
3030
$sessionEntityTypeName = $sessionEntityTypesClient
3131
->sessionEntityTypeName($projectId, $sessionId, $displayName);
3232
$sessionEntityTypesClient->deleteSessionEntityType($sessionEntityTypeName);

0 commit comments

Comments
 (0)