From f4e99300934f4c178e94499d2849570585d9a6cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sat, 30 May 2020 01:50:53 +0200 Subject: [PATCH 1/3] MAPG-78 replace loading SVG to an own version --- public/static/img/loading.svg | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/public/static/img/loading.svg b/public/static/img/loading.svg index 06e021e..fbf1cfa 100644 --- a/public/static/img/loading.svg +++ b/public/static/img/loading.svg @@ -1,11 +1,23 @@ - - + - - + + - - + + From d55caefda0e1f3bcf66f7d5c6cf0bfb0c3db2e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sat, 30 May 2020 01:51:13 +0200 Subject: [PATCH 2/3] MAPG-78 use svgo instead of html-minifier --- docker/Dockerfile | 2 +- scripts/minify.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f75e34b..2e68c87 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -23,7 +23,7 @@ RUN ./install-composer.sh # Install Node.js and required packages RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - RUN apt install -y nodejs -RUN npm install -g uglify-js clean-css-cli html-minifier +RUN npm install -g uglify-js clean-css-cli svgo EXPOSE 80 VOLUME /var/www/mapguesser diff --git a/scripts/minify.sh b/scripts/minify.sh index 79c1bb5..24b9398 100755 --- a/scripts/minify.sh +++ b/scripts/minify.sh @@ -6,4 +6,4 @@ ROOT_DIR=$(dirname $(readlink -f "$0"))/.. uglifyjs ${ROOT_DIR}/public/static/js/mapguesser.js -c -m -o ${ROOT_DIR}/public/static/js/mapguesser.js cleancss ${ROOT_DIR}/public/static/css/mapguesser.css -o ${ROOT_DIR}/public/static/css/mapguesser.css -html-minifier ${ROOT_DIR}/public/static/img/loading.svg --collapse-whitespace --remove-comments -o ${ROOT_DIR}/public/static/img/loading.svg +svgo ${ROOT_DIR}/public/static/img/loading.svg -o ${ROOT_DIR}/public/static/img/loading.svg From 675dd7cd073e3ea19a60cba7d19ce9aea2127856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sat, 30 May 2020 01:51:45 +0200 Subject: [PATCH 3/3] MAPG-78 [fix] add missing return types to some methods --- src/Database/Mysql/ResultSet.php | 6 +++--- src/Database/Query/Select.php | 4 ++-- src/Interfaces/Database/IResultSet.php | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Database/Mysql/ResultSet.php b/src/Database/Mysql/ResultSet.php index caf127c..adb7288 100644 --- a/src/Database/Mysql/ResultSet.php +++ b/src/Database/Mysql/ResultSet.php @@ -12,17 +12,17 @@ class ResultSet implements IResultSet $this->result = $result; } - public function fetch(int $type = IResultSet::FETCH_ASSOC) + public function fetch(int $type = IResultSet::FETCH_ASSOC): ?array { return $this->result->fetch_array($this->convertFetchType($type)); } - public function fetchAll(int $type = IResultSet::FETCH_ASSOC) + public function fetchAll(int $type = IResultSet::FETCH_ASSOC): array { return $this->result->fetch_all($this->convertFetchType($type)); } - public function fetchOneColumn(string $valueName, string $keyName = null) + public function fetchOneColumn(string $valueName, string $keyName = null): array { $array = []; diff --git a/src/Database/Query/Select.php b/src/Database/Query/Select.php index 4d32f9b..a379728 100644 --- a/src/Database/Query/Select.php +++ b/src/Database/Query/Select.php @@ -115,7 +115,7 @@ class Select return $this; } - public function orderBy($column, string $type = 'asc'): Select + public function orderBy($column, string $type = 'ASC'): Select { $this->orders[] = [$column, $type]; @@ -394,7 +394,7 @@ class Select $orders = $this->orders; array_walk($orders, function (&$value, $key) { - $value = $this->generateColumn($value[0]) . ' ' . $value[1]; + $value = $this->generateColumn($value[0]) . ' ' . strtoupper($value[1]); }); return implode(',', $orders); diff --git a/src/Interfaces/Database/IResultSet.php b/src/Interfaces/Database/IResultSet.php index 69d99f5..cf73cd0 100644 --- a/src/Interfaces/Database/IResultSet.php +++ b/src/Interfaces/Database/IResultSet.php @@ -8,9 +8,9 @@ interface IResultSet const FETCH_BOTH = 2; - public function fetch(int $type); + public function fetch(int $type): ?array; - public function fetchAll(int $type); + public function fetchAll(int $type): array; - public function fetchOneColumn(string $valueName, string $keyName); + public function fetchOneColumn(string $valueName, string $keyName): array; }