Skip to content

Commit

Permalink
removing all comments for possible deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
panbed committed Nov 20, 2024
1 parent b388b2c commit b9b523b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
30 changes: 15 additions & 15 deletions src/Services/AsyncEqualAccessReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public function postMultipleArrayAsync(array $contentItems): array {
$client = new Client();
$contentItemsReport = [];

$this->logToServer("Count contentItems:");
$this->logToServer(count($contentItems));
// $this->logToServer("Count contentItems:");
// $this->logToServer(count($contentItems));

// Combine every <num> pages into a request
$htmlArray = [];
Expand All @@ -91,7 +91,7 @@ public function postMultipleArrayAsync(array $contentItems): array {
// and create and sign a request that we send to the lambda function
$payload = json_encode(["html" => $htmlArray]);

$this->logToServer("Creating payload with size {$payloadSize}!");
// $this->logToServer("Creating payload with size {$payloadSize}!");

$request = $this->createRequest($payload);
$signedRequest = $this->sign($request);
Expand All @@ -102,8 +102,8 @@ public function postMultipleArrayAsync(array $contentItems): array {
$htmlArray = [];
}

$this->logToServer("Building up array of size {$payloadSize}:");
$this->logToServer($contentItem->getTitle());
// $this->logToServer("Building up array of size {$payloadSize}:");
// $this->logToServer($contentItem->getTitle());

// Get the HTML then clean up and push a page into an array
$html = $contentItem->getBody();
Expand All @@ -115,10 +115,10 @@ public function postMultipleArrayAsync(array $contentItems): array {

// Send out any leftover pages we might have
if (count($htmlArray) > 0) {
$this->logToServer("Found some leftovers");
// $this->logToServer("Found some leftovers");
// $pagesPayload = json_encode($htmlArray);

$this->logToServer(count($htmlArray));
// $this->logToServer(count($htmlArray));
$payload = json_encode(["html" => $htmlArray]);

$request = $this->createRequest($payload);
Expand All @@ -128,8 +128,8 @@ public function postMultipleArrayAsync(array $contentItems): array {
}


$this->logToServer("waiting for promises...");
$this->logToServer(count($promises));
// $this->logToServer("waiting for promises...");
// $this->logToServer(count($promises));

$results = Promise\Utils::unwrap($promises);

Expand All @@ -145,8 +145,8 @@ public function postMultipleArrayAsync(array $contentItems): array {
}
}

$this->logToServer("Number of contentItems we're sending back:");
$this->logToServer(count($contentItemsReport));
// $this->logToServer("Number of contentItems we're sending back:");
// $this->logToServer(count($contentItemsReport));

return $contentItemsReport;
}
Expand All @@ -160,7 +160,7 @@ public function postMultipleAsync(array $contentItems): array {
// Iterate through each scannable Canvas page and add a new
// POST request to our array of promises
foreach ($contentItems as $contentItem) {
$this->logToServer("Checking: {$contentItem->getTitle()}");
// $this->logToServer("Checking: {$contentItem->getTitle()}");
// Clean up the content item's HTML document
// then create a payload that we'll send to the lambda function
$html = $contentItem->getBody();
Expand All @@ -183,7 +183,7 @@ public function postMultipleAsync(array $contentItems): array {
$response = $result->getBody()->getContents();
$json = json_decode($response, true);
// $this->logToServer(json_encode($json, JSON_PRETTY_PRINT));
$this->logToServer("Saving to contentItemsReport...");
// $this->logToServer("Saving to contentItemsReport...");
$contentItemsReport[] = $json;
}

Expand All @@ -205,12 +205,12 @@ public function postSingleAsync(ContentItem $contentItem) {
$signedRequest = $this->sign($request);

// POST document to Lambda and wait for fulfillment
$this->logToServer("Sending to single promise...");
// $this->logToServer("Sending to single promise...");
$promise = $client->sendAsync($signedRequest);
$response = $promise->wait();

if ($response) {
$this->logToServer("Fulfilled!");
// $this->logToServer("Fulfilled!");

$contents = $response->getBody()->getContents();
$report = json_decode($contents, true)[0];
Expand Down
4 changes: 2 additions & 2 deletions src/Services/EqualAccessService.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function logToServer(string $message) {

public function xpathToSnippet($domXPath, $xpathQuery) {
// Query the document and save the results into an array
// In a perfect world this array should only have one element
// In a perfect world this array should only have one element

$xpathResults = $domXPath->query($xpathQuery);
$htmlSnippet = null;
Expand Down Expand Up @@ -87,7 +87,7 @@ public function checkforIgnoreClass($htmlSnippet) {

// Generate a UDOIT-style JSON report from the output of Equal Access
public function generateReport($json, $document) {
$this->logToServer("Generating report in EqualAccessService!");
// $this->logToServer("Generating report in EqualAccessService!");
$report = new PhpAllyReport();
$xpath = new DOMXPath($document);

Expand Down
4 changes: 2 additions & 2 deletions src/Services/LmsFetchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,15 @@ private function scanContentItems(array $contentItems)
}
}

$this->scanner->logToServer("done!");
// $this->scanner->logToServer("done!");
}
catch (\Exception $e) {
$this->util->createMessage($e->getMessage(), 'error', null, null, true);
}
}
$this->doctrine->getManager()->flush();

$this->scanner->logToServer("done!!!!!!!!!\n");
// $this->scanner->logToServer("done!!!!!!!!!\n");
}

public function createIssue(PhpAllyIssue $issue, ContentItem $contentItem)
Expand Down

0 comments on commit b9b523b

Please sign in to comment.