<commit_before><?php

namespace Berichtsheft\BaseBundle\BerichtsheftBuilder;

use Berichtsheft\BaseBundle\Model\AzubiInterface;
use Berichtsheft\BaseBundle\Model\Berichtsheft;
use Berichtsheft\BaseBundle\Model\BerichtsheftItem;
use Berichtsheft\BaseBundle\Worklog\WorklogRetriever;

class BerichtsheftBuilder implements BerichtsheftBuilderInterface
{
  /**
   * @var WorklogRetriever
   */
  protected $worklog_retriever;

  /**
   * @param WorklogRetriever $worklogRetriever
   */
  function __construct(WorklogRetriever $worklogRetriever)
  {
    $this->worklog_retriever = $worklogRetriever;
  }

  /**
   * @return WorklogRetriever
   */
  public function getWorklogRetriever()
  {
    return $this->worklog_retriever;
  }

  /**
   * @param AzubiInterface $azubi
   * @param int $week
   * @param int $year
   * @param int $number
   * @return Berichtsheft
   */
  public function generateBerichtsheft(AzubiInterface $azubi, $week, $year, $number = 1)
  {
    $from = new \DateTime($year . '-W' . str_pad($week, 2, 0) . '-1');
    $to = new \DateTime($year . '-W' . str_pad($week, 2, 0) . '-5');
    $berichtsheft = new Berichtsheft($azubi, $from, $to, $number);

    $worklog_items = $this->getWorklogRetriever()->retrieve($azubi, $from, $to);
    $items = array();
    foreach($worklog_items as $worklogItem)
    {
      $content = $worklogItem->getTitle() . ' - ' . $worklogItem->getComment();<commit_msg>- Anfang und Endpunkt der Woche werden korrekt berechnet<commit_after><?php

namespace Berichtsheft\BaseBundle\BerichtsheftBuilder;

use Berichtsheft\BaseBundle\Model\AzubiInterface;
use Berichtsheft\BaseBundle\Model\Berichtsheft;
use Berichtsheft\BaseBundle\Model\BerichtsheftItem;
use Berichtsheft\BaseBundle\Worklog\WorklogRetriever;

class BerichtsheftBuilder implements BerichtsheftBuilderInterface
{
  /**
   * @var WorklogRetriever
   */
  protected $worklog_retriever;

  /**
   * @param WorklogRetriever $worklogRetriever
   */
  function __construct(WorklogRetriever $worklogRetriever)
  {
    $this->worklog_retriever = $worklogRetriever;
  }

  /**
   * @return WorklogRetriever
   */
  public function getWorklogRetriever()
  {
    return $this->worklog_retriever;
  }

  /**
   * @param AzubiInterface $azubi
   * @param int $week
   * @param int $year
   * @param int $number
   * @return Berichtsheft
   */
  public function generateBerichtsheft(AzubiInterface $azubi, $week, $year, $number = 1)
  {
    $from = new \DateTime();
    $from->setISODate($year, $week);
    $to = new \DateTime();
    $to->setISODate($year, $week, 7);
    $berichtsheft = new Berichtsheft($azubi, $from, $to, $number);

    $worklog_items = $this->getWorklogRetriever()->retrieve($azubi, $from, $to);
    $items = array();
    foreach($worklog_items as $worklogItem)
    {
      $content = $worklogItem->getTitle() . ' - ' . $worklogItem->getComment();
{'fraction_non_alphanumeric': 0.13426573426573427, 'fraction_numerical': 0.003146853146853147, 'mean_word_length': 4.028119507908611, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5045498', 'n_tokens_mistral': 1032, 'n_tokens_neox': 1026, 'n_words': 182}