Skip to content

Commit

Permalink
Adding v1.0.7 modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasBagdanavicius committed Jun 9, 2023
1 parent 4d21927 commit 6907941
Show file tree
Hide file tree
Showing 141 changed files with 1,751 additions and 504 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.7](https://github.com/TomasBagdanavicius/stonetable/releases/tag/v1.0.7) - 2023-06-09

### Changed

- Improved responsiveness of main file and file listing loading.
- When a file is loaded and you press “R” key (and the modifier key is not held), the reload function will be called automatically.
- Qualified file paths as well as qualified namespace names that are not backed up by an existing file in filesystem will be underlined using wavy style in message text.
- Advanced PHP syntax highlighter improvements.
- PHP's "intl" extension is no longer compulsory, but recommended.
- New notifications will be shown above existing ones, instead of below them.
- Various small changes and fixes.
- Bump PHP Code Test Suite version to 1.0.7
- Bump Project Directory version to 1.0.7

### Added

- More highlighted elements with colors introduced as part of a broader initiative to colorize demo output and code messages, most notably:
- File path's basename;
- Namespace name's last component;
- Class names;
- etc.
- It’s now possible to switch to demo or unit file’s source code and back again (not to be confused with source file and its source code). A new "Toggle view" button was added to file's controls menubar.
- New API endpoint [remove-special-comments.php](src/web/api/remove-special-comments.php) that removes all special comments in a given test file.

## [1.0.6](https://github.com/TomasBagdanavicius/stonetable/releases/tag/v1.0.6) - 2023-05-09

### Changed
Expand Down
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Stonetable is lightweight, dependency-free, conceptual PHP project build and cod

## Stonetable Web Application

![Meet Stonetable](https://www.lwis.net/stonetable/images/meet-stonetable.webp?v=2)
![Meet Stonetable](https://www.lwis.net/stonetable/images/meet-stonetable.webp?v=3)

Stonetable's web application is the core component of the suite. This web app helps you navigate and visualize your PHP project builds by providing incentives to maintain organized demo and unit test files that can be outputted in a user friendly manner with enhanced state and error reporting.

Expand Down Expand Up @@ -49,8 +49,8 @@ First off, it's important to decide where you will want to install Stonetable. T

- Any web server
- PHP 8.1 or higher with extensions:
- `mbstring`
- `intl`
- `mbstring` (compulsory)
- `intl` (recommended)
- Any major web browser that is up to date

#### Quick Run
Expand Down Expand Up @@ -277,34 +277,34 @@ The above will output something similar to:
<article class="msg code-msg code-msg-warn">
<p class="text"><strong>Undefined variable <code class="code-php"><span class="var">$unexisting_variable</span></code></strong></p>
<dl>
<dt>Location</dt>
<dd><a href="vscode://file//Users/JohnDoe/stonetable/snippet.php:46" class="file">.../snippet.php<span class="line-num">:<span class="num">46</span></span></a></dd>
<dt>Type</dt>
<dt class="loc">Location</dt>
<dd><a href="vscode://file//Users/JohnDoe/stonetable/snippet.php:46" class="file"><span class="path">.../<span class="base ext-php">snippet.php</span></span><span class="line-num">:<span class="num">46</span></span></a></dd>
<dt class="type">Type</dt>
<dd>E_WARNING</dd>
</dl>
</article>
<article class="msg code-msg code-msg-err">
<p class="text"><strong>This is a simulated error: <a href="vscode://file//Users/JohnDoe/stonetable/snippet.php">VendorName\snippet</a></strong></p>
<p class="text"><strong>This is a simulated error: <span class="ns-name"><a href="vscode://file//Users/JohnDoe/stonetable/snippet.php">VendorName\<span class="base">snippet</a></span></span></strong></p>
<dl>
<dt>Location</dt>
<dd><a href="vscode://file//Users/JohnDoe/stonetable/snippet.php:50" class="file">.../snippet.php<span class="line-num">:<span class="num">50</span></span></a></dd>
<dt>Type</dt>
<dt class="loc">Location</dt>
<dd><a href="vscode://file//Users/JohnDoe/stonetable/snippet.php:50" class="file"><span class="path">.../<span class="base ext-php">snippet.php</span></span><span class="line-num">:<span class="num">50</span></span></a></dd>
<dt class="type">Type</dt>
<dd>E_RECOVERABLE_ERROR</dd>
<dt>Error Class</dt>
<dd>Error</dd>
<dt>Error Code</dt>
<dt class="err-cls">Error Class</dt>
<dd><span class="cls-name">Error</span></dd>
<dt class="err-code">Error Code</dt>
<dd>1</dd>
</dl>
<article class="msg code-msg code-msg-err">
<p class="text"><strong>This is the reason</strong></p>
<dl>
<dt>Location</dt>
<dd><a href="vscode://file//Users/JohnDoe/stonetable/snippet.php:53" class="file">.../snippet.php<span class="line-num">:<span class="num">53</span></span></a></dd>
<dt>Type</dt>
<dt class="loc">Location</dt>
<dd><a href="vscode://file//Users/JohnDoe/stonetable/snippet.php:53" class="file"><span class="path">.../<span class="base ext-php">snippet.php</span></span><span class="line-num">:<span class="num">53</span></span></a></dd>
<dt class="type">Type</dt>
<dd>E_RECOVERABLE_ERROR</dd>
<dt>Error Class</dt>
<dd>Exception</dd>
<dt>Error Code</dt>
<dt class="err-cls">Error Class</dt>
<dd><span class="cls-name">Exception</span></dd>
<dt class="err-code">Error Code</dt>
<dd>0</dd>
</dl>
</article>
Expand Down
2 changes: 1 addition & 1 deletion dist/stonetable/lib/php-code-test-suite/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @license MIT License
* @copyright Copyright (c) 2023 LWIS Technologies <[email protected]>
* (https://www.lwis.net/)
* @version 1.0.6
* @version 1.0.7
* @since 1.0.0
*/

Expand Down
81 changes: 56 additions & 25 deletions dist/stonetable/lib/php-code-test-suite/Debugger/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @license MIT License
* @copyright Copyright (c) 2023 LWIS Technologies <[email protected]>
* (https://www.lwis.net/)
* @version 1.0.6
* @version 1.0.7
* @since 1.0.0
*/

Expand Down Expand Up @@ -168,18 +168,19 @@ public function traceDataToCompactLine(

if( $format ) {

$result .= sprintf(
'<span class="file-path">%s</span>',
( $trace_data['class']
?? $formatter->shortenPathname($filename) )
);
$result .= ( isset($trace_data['class']) )
? $formatter->formatClassNameOrNamespace($trace_data['class'])
: $formatter::formatPathnameAddWrappers(
$formatter->shortenPathname($filename)
);

} else {

$result .= $formatter->shortenPathname($filename);
}

if( !isset($trace_data['class']) && $trace_data['line'] ) {

$result .= ( $format )
? sprintf(
'<span class="line-num">:<span class="num">%d</span>'
Expand All @@ -190,22 +191,34 @@ public function traceDataToCompactLine(
}

$result .= ( $trace_data['type'] ?? ' ' );
$result .= ( $format )
? sprintf(
'<span class="func-name">%s'
. '<span class="punc punc-brkt">(</span>'
. '<span class="punc punc-brkt">)</span>'
. '</span>',
$trace_data['function']
)
: ($trace_data['function'] . '()');

if( $format ) {

$separator_pos = strrpos($trace_data['function'], '\\');

if( $separator_pos === false ) {
$result .= $this->formatter->formatSimplifiedFunctionStr(
$trace_data['function']
);
} else {
$result .= $this->formatter->formatNamespaceName(
$trace_data['function'],
['func']
) . '<span class="punc punc-brkt">(</span>'
. '<span class="punc punc-brkt">)</span>';
}

} else {

$result .= ($trace_data['function'] . '()');
}

if( $format && $convert_links ) {

$result = $formatter->buildIdeHtmlLink(
$filename,
$result,
((int)$trace_data['line'] ?? null),
( (int)$trace_data['line'] ?? null ),
class_names: ['file']
);
}
Expand All @@ -225,20 +238,27 @@ class_names: ['file']

if( is_object($arg) ) {

$class = $arg::class;
$formatted_class = $formatter->formatClassNameOrNamespace(
$class
);
$argument = ( $convert_links )
? $formatter->namespaceToIdeHtmlLink($arg::class)
: $arg::class;
? $formatter->namespaceToIdeHtmlLink(
$class,
text: $formatted_class
)
: $formatted_class;

if( !$argument ) {
$argument = $arg::class;
$argument = $formatted_class;
}

$allow_html_entities = false;

/* Don't attempt to export and show text for the following
types, eg. `var_export` will fail on large arrays containing
objects with circular reference, etc. */
} elseif( is_array($arg) && is_resource($arg) ) {
} elseif( is_array($arg) || is_resource($arg) ) {

$argument = '';

Expand All @@ -249,11 +269,11 @@ class_names: ['file']

// String (can be file path or namespace name).
if(
str_starts_with($argument, '\'')
&& str_ends_with($argument, '\'')
str_starts_with($argument, "'")
&& str_ends_with($argument, "'")
) {

$trimmed_arg = trim($argument, '\'');
$trimmed_arg = trim($argument, "'");
$length = strlen($trimmed_arg);

if( $formatter->isQualifiedPathname($trimmed_arg) ) {
Expand All @@ -273,12 +293,23 @@ class_names: ['file']
'\\',
$trimmed_arg
);
if( $format ) {
$namespace_formatted
= $formatter->formatClassNameOrNamespace(
$namespace
);
}
$argument = ( $convert_links )
? $formatter->namespaceToIdeHtmlLink(
$namespace,
class_names: ['file']
class_names: ['file'],
text: $namespace_formatted
)
: $namespace;
: ( ( $format )
? $namespace_formatted
: $namespace );
$allow_html_entities = false;
}

Expand Down
Loading

0 comments on commit 6907941

Please sign in to comment.